… | |
… | |
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 | { |