… | |
… | |
297 | ns->pl = 0; |
297 | ns->pl = 0; |
298 | ns = 0; |
298 | ns = 0; |
299 | } |
299 | } |
300 | |
300 | |
301 | if (ob) |
301 | if (ob) |
|
|
302 | { |
302 | ob->close_container (); //TODO: client-specific |
303 | ob->close_container (); //TODO: client-specific |
|
|
304 | ob->drop_unpaid_items (); |
|
|
305 | } |
303 | |
306 | |
304 | observe = ob; |
307 | observe = ob; |
305 | |
308 | |
306 | deactivate (); |
309 | deactivate (); |
307 | } |
310 | } |
… | |
… | |
2313 | /* This goes throws the inventory and removes unpaid objects, and puts them |
2316 | /* This goes throws the inventory and removes unpaid objects, and puts them |
2314 | * back in the map (location and map determined by values of env). This |
2317 | * back in the map (location and map determined by values of env). This |
2315 | * function will descend into containers. op is the object to start the search |
2318 | * function will descend into containers. op is the object to start the search |
2316 | * from. |
2319 | * from. |
2317 | */ |
2320 | */ |
2318 | void |
2321 | static void |
2319 | remove_unpaid_objects (object *op, object *env) |
2322 | drop_unpaid_items (object *op, object *env) |
2320 | { |
2323 | { |
2321 | while (op) |
2324 | while (op) |
2322 | { |
2325 | { |
2323 | object *next = op->below; /* Make sure we have a good value, in case we remove object 'op' */ |
2326 | object *next = op->below; /* Make sure we have a good value, in case we remove object 'op' */ |
2324 | |
2327 | |
… | |
… | |
2328 | esrv_del_item (env->contr, op->count); |
2331 | esrv_del_item (env->contr, op->count); |
2329 | |
2332 | |
2330 | op->insert_at (env); |
2333 | op->insert_at (env); |
2331 | } |
2334 | } |
2332 | else if (op->inv) |
2335 | else if (op->inv) |
2333 | remove_unpaid_objects (op->inv, env); |
2336 | drop_unpaid_items (op->inv, env); |
2334 | |
2337 | |
2335 | op = next; |
2338 | op = next; |
2336 | } |
2339 | } |
|
|
2340 | } |
|
|
2341 | |
|
|
2342 | void |
|
|
2343 | object::drop_unpaid_items () |
|
|
2344 | { |
|
|
2345 | if (!flag [FLAG_REMOVED]) |
|
|
2346 | ::drop_unpaid_items (inv, this); |
2337 | } |
2347 | } |
2338 | |
2348 | |
2339 | /* |
2349 | /* |
2340 | * Returns pointer a static string containing gravestone text |
2350 | * Returns pointer a static string containing gravestone text |
2341 | * Moved from apply.c to player.c - player.c is what |
2351 | * Moved from apply.c to player.c - player.c is what |
… | |
… | |
2623 | object *tmp; |
2633 | object *tmp; |
2624 | |
2634 | |
2625 | if (save_life (op)) |
2635 | if (save_life (op)) |
2626 | return; |
2636 | return; |
2627 | |
2637 | |
2628 | |
|
|
2629 | /* If player dies on BATTLEGROUND, no stat/exp loss! For Combat-Arenas |
2638 | /* If player dies on BATTLEGROUND, no stat/exp loss! For Combat-Arenas |
2630 | * in cities ONLY!!! It is very important that this doesn't get abused. |
2639 | * in cities ONLY!!! It is very important that this doesn't get abused. |
2631 | * Look at op_on_battleground() for more info --AndreasV |
2640 | * Look at op_on_battleground() for more info --AndreasV |
2632 | */ |
2641 | */ |
2633 | if (op_on_battleground (op, &x, &y)) |
2642 | if (op_on_battleground (op, &x, &y)) |
… | |
… | |
2872 | |
2881 | |
2873 | /* |
2882 | /* |
2874 | * Check to see if the player has any unpaid items. If so, remove them |
2883 | * Check to see if the player has any unpaid items. If so, remove them |
2875 | * and put them back in the map. |
2884 | * and put them back in the map. |
2876 | */ |
2885 | */ |
2877 | remove_unpaid_objects (op->inv, op); |
2886 | op->drop_unpaid_items (); |
2878 | |
2887 | |
2879 | /****************************************/ |
2888 | /****************************************/ |
2880 | /* */ |
2889 | /* */ |
2881 | /* Move player to his current respawn- */ |
2890 | /* Move player to his current respawn- */ |
2882 | /* position (usually last savebed) */ |
2891 | /* position (usually last savebed) */ |