ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/object.C
(Generate patch)

Comparing deliantra/server/common/object.C (file contents):
Revision 1.175 by root, Fri Aug 10 01:47:52 2007 UTC vs.
Revision 1.178 by root, Sun Aug 12 14:13:54 2007 UTC

2344 * Cf 0.91.3 - don't let WIZ's pick up anything - will likely cause 2344 * Cf 0.91.3 - don't let WIZ's pick up anything - will likely cause
2345 * core dumps if they do. 2345 * core dumps if they do.
2346 * 2346 *
2347 * Add a check so we can't pick up invisible objects (0.93.8) 2347 * Add a check so we can't pick up invisible objects (0.93.8)
2348 */ 2348 */
2349
2350int 2349int
2351can_pick (const object *who, const object *item) 2350can_pick (const object *who, const object *item)
2352{ 2351{
2353 return /*QUERY_FLAG(who,FLAG_WIZ)|| */ 2352 return /*QUERY_FLAG(who,FLAG_WIZ)|| */
2354 (item->weight > 0 && !QUERY_FLAG (item, FLAG_NO_PICK) && 2353 (item->weight > 0 && !QUERY_FLAG (item, FLAG_NO_PICK) &&
2669 old_container->flag [FLAG_APPLIED] = 0; 2668 old_container->flag [FLAG_APPLIED] = 0;
2670 container = 0; 2669 container = 0;
2671 2670
2672 esrv_update_item (UPD_FLAGS, this, old_container); 2671 esrv_update_item (UPD_FLAGS, this, old_container);
2673 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"));
2674 } 2674 }
2675 2675
2676 if (new_container) 2676 if (new_container)
2677 { 2677 {
2678 if (INVOKE_OBJECT (OPEN, new_container, ARG_OBJECT (this))) 2678 if (INVOKE_OBJECT (OPEN, new_container, ARG_OBJECT (this)))
2694 new_container->flag [FLAG_APPLIED] = 1; 2694 new_container->flag [FLAG_APPLIED] = 1;
2695 container = new_container; 2695 container = new_container;
2696 2696
2697 esrv_update_item (UPD_FLAGS, this, new_container); 2697 esrv_update_item (UPD_FLAGS, this, new_container);
2698 esrv_send_inventory (this, new_container); 2698 esrv_send_inventory (this, new_container);
2699 play_sound (sound_find ("chest_open"));
2699 } 2700 }
2700} 2701}
2701 2702
2702object * 2703object *
2703object::force_find (const shstr name) 2704object::force_find (const shstr name)
2729 force->flag [FLAG_APPLIED] = true; 2730 force->flag [FLAG_APPLIED] = true;
2730 2731
2731 insert (force); 2732 insert (force);
2732} 2733}
2733 2734
2735void
2736object::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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines