… | |
… | |
21 | * |
21 | * |
22 | * The author can be reached via e-mail to <crossfire@schmorp.de> |
22 | * The author can be reached via e-mail to <crossfire@schmorp.de> |
23 | */ |
23 | */ |
24 | |
24 | |
25 | #include <global.h> |
25 | #include <global.h> |
26 | #include <pwd.h> |
|
|
27 | #include <sproto.h> |
26 | #include <sproto.h> |
28 | #include <sounds.h> |
27 | #include <sounds.h> |
29 | #include <living.h> |
28 | #include <living.h> |
30 | #include <object.h> |
29 | #include <object.h> |
31 | #include <spells.h> |
30 | #include <spells.h> |
… | |
… | |
208 | |
207 | |
209 | players.erase (this); |
208 | players.erase (this); |
210 | } |
209 | } |
211 | |
210 | |
212 | // connect the player with a specific client |
211 | // connect the player with a specific client |
213 | // also changed, rationalises, and fixes some incorrect settings |
212 | // also changes, rationalises, and fixes some incorrect settings |
214 | void |
213 | void |
215 | player::connect (client *ns) |
214 | player::connect (client *ns) |
216 | { |
215 | { |
217 | this->ns = ns; |
216 | this->ns = ns; |
218 | ns->pl = this; |
217 | ns->pl = this; |
… | |
… | |
258 | } |
257 | } |
259 | |
258 | |
260 | new_draw_info (NDI_UNIQUE, 0, ob, "Welcome Back!"); |
259 | new_draw_info (NDI_UNIQUE, 0, ob, "Welcome Back!"); |
261 | |
260 | |
262 | esrv_new_player (this, ob->weight + ob->carrying); |
261 | esrv_new_player (this, ob->weight + ob->carrying); |
|
|
262 | |
|
|
263 | for (object *op = ob->inv; op; op = op->below) |
|
|
264 | if (op->flag [FLAG_APPLIED]) |
|
|
265 | switch (op->type) |
|
|
266 | { |
|
|
267 | case WAND: |
|
|
268 | case ROD: |
|
|
269 | case HORN: |
|
|
270 | case BOW: |
|
|
271 | case SKILL: |
|
|
272 | case SKILL_TOOL: |
|
|
273 | case WEAPON: |
|
|
274 | fprintf (stderr, "applied<%s>\n", &op->name);//D |
|
|
275 | apply_special (ob, op, AP_UNAPPLY); |
|
|
276 | apply_special (ob, op, AP_APPLY); |
|
|
277 | break; |
|
|
278 | } |
263 | |
279 | |
264 | ob->update_stats (); |
280 | ob->update_stats (); |
265 | ns->floorbox_update (); |
281 | ns->floorbox_update (); |
266 | |
282 | |
267 | esrv_send_inventory (ob, ob); |
283 | esrv_send_inventory (ob, ob); |
… | |
… | |
1009 | /* Cornered, get rid of scared */ |
1025 | /* Cornered, get rid of scared */ |
1010 | CLEAR_FLAG (op, FLAG_SCARED); |
1026 | CLEAR_FLAG (op, FLAG_SCARED); |
1011 | op->enemy = NULL; |
1027 | op->enemy = NULL; |
1012 | } |
1028 | } |
1013 | |
1029 | |
1014 | |
|
|
1015 | /* check_pick sees if there is stuff to be picked up/picks up stuff. |
1030 | /* check_pick sees if there is stuff to be picked up/picks up stuff. |
1016 | * IT returns 1 if the player should keep on moving, 0 if he should |
1031 | * It returns 1 if the player should keep on moving, 0 if he should |
1017 | * stop. |
1032 | * stop. |
1018 | */ |
1033 | */ |
1019 | int |
1034 | int |
1020 | check_pick (object *op) |
1035 | check_pick (object *op) |
1021 | { |
1036 | { |