… | |
… | |
997 | attacked_by = 0; |
997 | attacked_by = 0; |
998 | current_weapon = 0; |
998 | current_weapon = 0; |
999 | } |
999 | } |
1000 | |
1000 | |
1001 | void |
1001 | void |
1002 | object::destroy (bool destroy_inventory) |
1002 | object::destroy () |
1003 | { |
1003 | { |
1004 | if (destroyed ()) |
1004 | if (destroyed ()) |
1005 | return; |
1005 | return; |
1006 | |
1006 | |
1007 | if (!is_head () && !head->destroyed ()) |
1007 | if (!is_head () && !head->destroyed ()) |
1008 | { |
1008 | { |
1009 | LOG (llevError | logBacktrace, "tried to destroy the tail of an object"); |
1009 | LOG (llevError | logBacktrace, "tried to destroy the tail of an object"); |
1010 | head->destroy (destroy_inventory); |
1010 | head->destroy (); |
1011 | return; |
1011 | return; |
1012 | } |
1012 | } |
1013 | |
1013 | |
1014 | destroy_inv (!destroy_inventory); |
1014 | destroy_inv (false); |
1015 | |
1015 | |
1016 | if (is_head ()) |
1016 | if (is_head ()) |
1017 | if (sound_destroy) |
1017 | if (sound_destroy) |
1018 | play_sound (sound_destroy); |
1018 | play_sound (sound_destroy); |
1019 | else if (flag [FLAG_MONSTER]) |
1019 | else if (flag [FLAG_MONSTER]) |