… | |
… | |
960 | return; |
960 | return; |
961 | |
961 | |
962 | if (destroy_inventory) |
962 | if (destroy_inventory) |
963 | destroy_inv (false); |
963 | destroy_inv (false); |
964 | |
964 | |
|
|
965 | if (is_head ()) |
|
|
966 | if (sound_destroy) |
|
|
967 | play_sound (sound_destroy); |
|
|
968 | else if (flag [FLAG_MONSTER]) |
|
|
969 | play_sound (sound_find ("monster_destroy")); // quick hack, too lazy to create a generic mechanism |
|
|
970 | |
965 | attachable::destroy (); |
971 | attachable::destroy (); |
966 | } |
972 | } |
967 | |
973 | |
968 | /* |
974 | /* |
969 | * sub_weight() recursively (outwards) subtracts a number from the |
975 | * sub_weight() recursively (outwards) subtracts a number from the |
… | |
… | |
1089 | { |
1095 | { |
1090 | /* No point updating the players look faces if he is the object |
1096 | /* No point updating the players look faces if he is the object |
1091 | * being removed. |
1097 | * being removed. |
1092 | */ |
1098 | */ |
1093 | |
1099 | |
1094 | if (tmp->type == PLAYER && tmp != this) |
1100 | if (tmp->type == PLAYER && tmp->container == this) |
1095 | { |
|
|
1096 | /* If a container that the player is currently using somehow gets |
1101 | /* If a container that the player is currently using somehow gets |
1097 | * removed (most likely destroyed), update the player view |
1102 | * removed (most likely destroyed), update the player view |
1098 | * appropriately. |
1103 | * appropriately. |
1099 | */ |
1104 | */ |
1100 | if (tmp->container == this) |
|
|
1101 | { |
|
|
1102 | flag [FLAG_APPLIED] = 0; |
|
|
1103 | tmp->container = 0; |
1105 | tmp->close_container (); |
1104 | } |
|
|
1105 | |
|
|
1106 | if (tmp->contr->ns) |
|
|
1107 | tmp->contr->ns->floorbox_update (); |
|
|
1108 | } |
|
|
1109 | |
1106 | |
1110 | /* See if object moving off should effect something */ |
1107 | /* See if object moving off should effect something */ |
1111 | if (check_walk_off |
1108 | if (check_walk_off |
1112 | && ((move_type & tmp->move_off) |
1109 | && ((move_type & tmp->move_off) |
1113 | && (move_type & ~tmp->move_off & ~tmp->move_block) == 0)) |
1110 | && (move_type & ~tmp->move_off & ~tmp->move_block) == 0)) |
… | |
… | |
2728 | force->flag [FLAG_APPLIED] = true; |
2725 | force->flag [FLAG_APPLIED] = true; |
2729 | |
2726 | |
2730 | insert (force); |
2727 | insert (force); |
2731 | } |
2728 | } |
2732 | |
2729 | |
2733 | void |
|
|
2734 | object::play_sound (faceidx sound) const |
|
|
2735 | { |
|
|
2736 | if (map) |
|
|
2737 | map->play_sound (sound, x, y); |
|
|
2738 | } |
|
|