… | |
… | |
963 | |
963 | |
964 | void |
964 | void |
965 | object::do_destroy () |
965 | object::do_destroy () |
966 | { |
966 | { |
967 | if (flag [FLAG_IS_LINKED]) |
967 | if (flag [FLAG_IS_LINKED]) |
968 | remove_button_link (this); |
968 | remove_link (); |
969 | |
969 | |
970 | if (flag [FLAG_FRIENDLY]) |
970 | if (flag [FLAG_FRIENDLY]) |
971 | remove_friendly_object (this); |
971 | remove_friendly_object (this); |
972 | |
972 | |
973 | remove (); |
973 | remove (); |
… | |
… | |
2174 | * This basically means that if direction is 15, then it could either go |
2174 | * This basically means that if direction is 15, then it could either go |
2175 | * direction 4, 14, or 16 to get back to where we are. |
2175 | * direction 4, 14, or 16 to get back to where we are. |
2176 | * Moved from spell_util.c to object.c with the other related direction |
2176 | * Moved from spell_util.c to object.c with the other related direction |
2177 | * functions. |
2177 | * functions. |
2178 | */ |
2178 | */ |
2179 | int reduction_dir[SIZEOFFREE][3] = { |
2179 | const int reduction_dir[SIZEOFFREE][3] = { |
2180 | {0, 0, 0}, /* 0 */ |
2180 | {0, 0, 0}, /* 0 */ |
2181 | {0, 0, 0}, /* 1 */ |
2181 | {0, 0, 0}, /* 1 */ |
2182 | {0, 0, 0}, /* 2 */ |
2182 | {0, 0, 0}, /* 2 */ |
2183 | {0, 0, 0}, /* 3 */ |
2183 | {0, 0, 0}, /* 3 */ |
2184 | {0, 0, 0}, /* 4 */ |
2184 | {0, 0, 0}, /* 4 */ |
… | |
… | |
2563 | |
2563 | |
2564 | return insert (force); |
2564 | return insert (force); |
2565 | } |
2565 | } |
2566 | |
2566 | |
2567 | void |
2567 | void |
2568 | object::play_sound (faceidx sound) |
2568 | object::play_sound (faceidx sound) const |
2569 | { |
2569 | { |
2570 | if (!sound) |
2570 | if (!sound) |
2571 | return; |
2571 | return; |
2572 | |
2572 | |
2573 | if (flag [FLAG_REMOVED]) |
2573 | if (is_on_map ()) |
2574 | return; |
|
|
2575 | |
|
|
2576 | if (env) |
|
|
2577 | { |
|
|
2578 | if (object *pl = in_player ()) |
|
|
2579 | pl->contr->play_sound (sound); |
|
|
2580 | } |
|
|
2581 | else |
|
|
2582 | map->play_sound (sound, x, y); |
2574 | map->play_sound (sound, x, y); |
|
|
2575 | else if (object *pl = in_player ()) |
|
|
2576 | pl->contr->play_sound (sound); |
|
|
2577 | } |
|
|
2578 | |
|
|
2579 | void |
|
|
2580 | object::say_msg (const char *msg) const |
|
|
2581 | { |
|
|
2582 | if (is_on_map ()) |
|
|
2583 | map->say_msg (msg, x, y); |
|
|
2584 | else if (object *pl = in_player ()) |
|
|
2585 | pl->contr->play_sound (sound); |
2583 | } |
2586 | } |
2584 | |
2587 | |
2585 | void |
2588 | void |
2586 | object::make_noise () |
2589 | object::make_noise () |
2587 | { |
2590 | { |