… | |
… | |
239 | set_dragon_name (ob, abil, skin); |
239 | set_dragon_name (ob, abil, skin); |
240 | } |
240 | } |
241 | |
241 | |
242 | new_draw_info (NDI_UNIQUE, 0, ob, "Welcome Back!"); |
242 | new_draw_info (NDI_UNIQUE, 0, ob, "Welcome Back!"); |
243 | |
243 | |
244 | esrv_new_player (this, ob->weight + ob->carrying); |
244 | esrv_new_player (this); |
245 | |
245 | |
246 | ob->update_stats (); |
246 | ob->update_stats (); |
247 | |
247 | |
248 | ns->floorbox_update (); |
248 | ns->floorbox_update (); |
249 | esrv_send_inventory (ob, ob); |
249 | esrv_send_inventory (ob, ob); |
… | |
… | |
851 | */ |
851 | */ |
852 | void |
852 | void |
853 | player::chargen_race_done () |
853 | player::chargen_race_done () |
854 | { |
854 | { |
855 | /* this must before then initial items are given */ |
855 | /* this must before then initial items are given */ |
856 | esrv_new_player (ob->contr, ob->weight + ob->carrying); |
856 | esrv_new_player (ob->contr); |
857 | |
857 | |
858 | treasurelist *tl = treasurelist::find ("starting_wealth"); |
858 | treasurelist *tl = treasurelist::find ("starting_wealth"); |
859 | if (tl) |
859 | if (tl) |
860 | create_treasure (tl, ob, 0, 0, 0); |
860 | create_treasure (tl, ob, 0, 0, 0); |
861 | |
861 | |
… | |
… | |
1792 | CLEAR_FLAG (item, FLAG_ANIMATE); |
1792 | CLEAR_FLAG (item, FLAG_ANIMATE); |
1793 | item->face = item->arch->face; |
1793 | item->face = item->arch->face; |
1794 | item->set_speed (0); |
1794 | item->set_speed (0); |
1795 | } |
1795 | } |
1796 | |
1796 | |
1797 | if ((tmp = item->in_player ())) |
1797 | if (object *pl = item->visible_to ()) |
1798 | esrv_update_item (UPD_ANIM, tmp, item); |
1798 | esrv_update_item (UPD_ANIM, pl, item); |
1799 | } |
1799 | } |
1800 | } |
1800 | } |
1801 | else if (item->type == ROD || item->type == HORN) |
1801 | else if (item->type == ROD || item->type == HORN) |
1802 | drain_rod_charge (item); |
1802 | drain_rod_charge (item); |
1803 | } |
1803 | } |
… | |
… | |
1980 | remove_door2 (door); /* remove door without violence ;-) */ |
1980 | remove_door2 (door); /* remove door without violence ;-) */ |
1981 | } |
1981 | } |
1982 | |
1982 | |
1983 | /* Do this after we print the message */ |
1983 | /* Do this after we print the message */ |
1984 | key->decrease (); /* Use up one of the keys */ |
1984 | key->decrease (); /* Use up one of the keys */ |
1985 | /* Need to update the weight the container the key was in */ |
|
|
1986 | if (container != op) |
|
|
1987 | esrv_update_item (UPD_WEIGHT, op, container); |
|
|
1988 | |
1985 | |
1989 | return 1; /* Nothing more to do below */ |
1986 | return 1; /* Nothing more to do below */ |
1990 | } |
1987 | } |
1991 | else if (door->type == LOCKED_DOOR) |
1988 | else if (door->type == LOCKED_DOOR) |
1992 | { |
1989 | { |
… | |
… | |
2292 | return 0; |
2289 | return 0; |
2293 | } |
2290 | } |
2294 | |
2291 | |
2295 | /* This goes throws the inventory and removes unpaid objects, and puts them |
2292 | /* This goes throws the inventory and removes unpaid objects, and puts them |
2296 | * back in the map (location and map determined by values of env). This |
2293 | * back in the map (location and map determined by values of env). This |
2297 | * function will descend into containers. op is the object to start the search |
2294 | * function will descend into containers. op is the object to start the search |
2298 | * from. |
2295 | * from. |
2299 | */ |
2296 | */ |
2300 | static void |
2297 | static void |
2301 | drop_unpaid_items (object *op, object *env) |
2298 | drop_unpaid_items (object *op, object *env) |
2302 | { |
2299 | { |
2303 | while (op) |
2300 | while (op) |
2304 | { |
2301 | { |
2305 | object *next = op->below; /* Make sure we have a good value, in case we remove object 'op' */ |
2302 | object *next = op->below; /* Make sure we have a good value, in case we remove object 'op' */ |
2306 | |
2303 | |
2307 | if (QUERY_FLAG (op, FLAG_UNPAID)) |
2304 | if (QUERY_FLAG (op, FLAG_UNPAID)) |
2308 | { |
|
|
2309 | if (env->type == PLAYER) |
|
|
2310 | esrv_del_item (env->contr, op->count); |
|
|
2311 | |
|
|
2312 | op->insert_at (env); |
2305 | op->insert_at (env); |
2313 | } |
|
|
2314 | else if (op->inv) |
2306 | else if (op->inv) |
2315 | drop_unpaid_items (op->inv, env); |
2307 | drop_unpaid_items (op->inv, env); |
2316 | |
2308 | |
2317 | op = next; |
2309 | op = next; |
2318 | } |
2310 | } |
… | |
… | |
3452 | else |
3444 | else |
3453 | { |
3445 | { |
3454 | /* generate misc. treasure */ |
3446 | /* generate misc. treasure */ |
3455 | tmp = arch_to_object (tr->item); |
3447 | tmp = arch_to_object (tr->item); |
3456 | new_draw_info_format (NDI_UNIQUE | NDI_BLUE, 0, who, "You gained %s", query_short_name (tmp)); |
3448 | new_draw_info_format (NDI_UNIQUE | NDI_BLUE, 0, who, "You gained %s", query_short_name (tmp)); |
3457 | tmp = insert_ob_in_ob (tmp, who); |
3449 | who->insert (tmp); |
3458 | if (who->type == PLAYER) |
|
|
3459 | esrv_send_item (who, tmp); |
|
|
3460 | } |
3450 | } |
3461 | } |
3451 | } |
3462 | |
3452 | |
3463 | /** |
3453 | /** |
3464 | * Unready an object for a player. This function does nothing if the object was |
3454 | * Unready an object for a player. This function does nothing if the object was |