… | |
… | |
2668 | old_container->flag [FLAG_APPLIED] = 0; |
2668 | old_container->flag [FLAG_APPLIED] = 0; |
2669 | container = 0; |
2669 | container = 0; |
2670 | |
2670 | |
2671 | esrv_update_item (UPD_FLAGS, this, old_container); |
2671 | esrv_update_item (UPD_FLAGS, this, old_container); |
2672 | new_draw_info_format (NDI_UNIQUE, 0, this, "You close %s.", query_name (old_container)); |
2672 | new_draw_info_format (NDI_UNIQUE, 0, this, "You close %s.", query_name (old_container)); |
|
|
2673 | play_sound (sound_find ("chest_close")); |
2673 | } |
2674 | } |
2674 | |
2675 | |
2675 | if (new_container) |
2676 | if (new_container) |
2676 | { |
2677 | { |
2677 | if (INVOKE_OBJECT (OPEN, new_container, ARG_OBJECT (this))) |
2678 | if (INVOKE_OBJECT (OPEN, new_container, ARG_OBJECT (this))) |
… | |
… | |
2693 | new_container->flag [FLAG_APPLIED] = 1; |
2694 | new_container->flag [FLAG_APPLIED] = 1; |
2694 | container = new_container; |
2695 | container = new_container; |
2695 | |
2696 | |
2696 | esrv_update_item (UPD_FLAGS, this, new_container); |
2697 | esrv_update_item (UPD_FLAGS, this, new_container); |
2697 | esrv_send_inventory (this, new_container); |
2698 | esrv_send_inventory (this, new_container); |
|
|
2699 | play_sound (sound_find ("chest_open")); |
2698 | } |
2700 | } |
2699 | } |
2701 | } |
2700 | |
2702 | |
2701 | object * |
2703 | object * |
2702 | object::force_find (const shstr name) |
2704 | object::force_find (const shstr name) |
… | |
… | |
2728 | force->flag [FLAG_APPLIED] = true; |
2730 | force->flag [FLAG_APPLIED] = true; |
2729 | |
2731 | |
2730 | insert (force); |
2732 | insert (force); |
2731 | } |
2733 | } |
2732 | |
2734 | |
|
|
2735 | void |
|
|
2736 | object::play_sound (faceidx sound) const |
|
|
2737 | { |
|
|
2738 | if (!sound) |
|
|
2739 | return; |
|
|
2740 | |
|
|
2741 | if (flag [FLAG_REMOVED]) |
|
|
2742 | return; |
|
|
2743 | |
|
|
2744 | if (env) |
|
|
2745 | { |
|
|
2746 | if (object *pl = in_player ()) |
|
|
2747 | pl->contr->play_sound (sound); |
|
|
2748 | } |
|
|
2749 | else |
|
|
2750 | map->play_sound (sound, x, y); |
|
|
2751 | } |
|
|
2752 | |