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.247 by root, Mon Jul 14 18:36:43 2008 UTC vs.
Revision 1.252 by root, Mon Aug 11 23:23:41 2008 UTC

345 else 345 else
346 { 346 {
347 // maybe there is a player standing on the same mapspace 347 // maybe there is a player standing on the same mapspace
348 // this will catch the case where "this" is a player 348 // this will catch the case where "this" is a player
349 if (object *pl = ms ().player ()) 349 if (object *pl = ms ().player ())
350 if ((!pl->container && pl->contr->ns && !pl->contr->ns->update_look)
350 if (!pl->container || this == pl->container) 351 || this == pl->container)
351 return pl; 352 return pl;
352 } 353 }
353 } 354 }
354 355
355 return 0; 356 return 0;
761 else if (action == UP_OBJ_INSERT) 762 else if (action == UP_OBJ_INSERT)
762 { 763 {
763 // this is likely overkill, TODO: revisit (schmorp) 764 // this is likely overkill, TODO: revisit (schmorp)
764 if ((QUERY_FLAG (op, FLAG_BLOCKSVIEW) && !(m.flags_ & P_BLOCKSVIEW)) 765 if ((QUERY_FLAG (op, FLAG_BLOCKSVIEW) && !(m.flags_ & P_BLOCKSVIEW))
765 || (QUERY_FLAG (op, FLAG_NO_MAGIC) && !(m.flags_ & P_NO_MAGIC)) 766 || (QUERY_FLAG (op, FLAG_NO_MAGIC) && !(m.flags_ & P_NO_MAGIC))
766 || (op->type == PLAYER && !(m.flags_ & P_PLAYER))
767 || (op->type == SAFE_GROUND && !(m.flags_ & P_SAFE)) 767 || (op->type == SAFE_GROUND && !(m.flags_ & P_SAFE))
768 || (QUERY_FLAG (op, FLAG_ALIVE) && !(m.flags_ & P_IS_ALIVE)) 768 || (QUERY_FLAG (op, FLAG_ALIVE) && !(m.flags_ & P_IS_ALIVE))
769 || (QUERY_FLAG (op, FLAG_DAMNED) && !(m.flags_ & P_NO_CLERIC)) 769 || (QUERY_FLAG (op, FLAG_DAMNED) && !(m.flags_ & P_NO_CLERIC))
770 || (m.move_on | op->move_on ) != m.move_on 770 || (m.move_on | op->move_on ) != m.move_on
771 || (m.move_off | op->move_off ) != m.move_off 771 || (m.move_off | op->move_off ) != m.move_off
772 || (m.move_slow | op->move_slow) != m.move_slow 772 || (m.move_slow | op->move_slow) != m.move_slow
773 /* This isn't perfect, but I don't expect a lot of objects to 773 /* This isn't perfect, but I don't expect a lot of objects to
774 * to have move_allow right now. 774 * have move_allow right now.
775 */ 775 */
776 || ((m.move_block | op->move_block) & ~op->move_allow) != m.move_block 776 || ((m.move_block | op->move_block) & ~op->move_allow) != m.move_block
777 || 1) // the above is not strong enough a test to skip updating. los maybe? TODO (Schmorp) 777 || 1) // the above is not strong enough a test to skip updating. los maybe? TODO (Schmorp)
778 m.flags_ = 0; 778 m.flags_ = 0;
779 } 779 }
909 || map->in_memory != MAP_ACTIVE 909 || map->in_memory != MAP_ACTIVE
910 || map->no_drop 910 || map->no_drop
911 || ms ().move_block == MOVE_ALL) 911 || ms ().move_block == MOVE_ALL)
912 { 912 {
913 while (inv) 913 while (inv)
914 {
915 inv->destroy_inv (false);
916 inv->destroy (); 914 inv->destroy (true);
917 }
918 } 915 }
919 else 916 else
920 { /* Put objects in inventory onto this space */ 917 { /* Put objects in inventory onto this space */
921 while (inv) 918 while (inv)
922 { 919 {
1537 if (!nr) 1534 if (!nr)
1538 return true; 1535 return true;
1539 1536
1540 nr = min (nr, nrof); 1537 nr = min (nr, nrof);
1541 1538
1539 if (nrof > nr)
1540 {
1542 nrof -= nr; 1541 nrof -= nr;
1543
1544 if (nrof)
1545 {
1546 adjust_weight (env, -weight * max (1, nr)); // carrying == 0 1542 adjust_weight (env, -weight * max (1, nr)); // carrying == 0
1547 1543
1548 if (object *pl = visible_to ()) 1544 if (object *pl = visible_to ())
1549 esrv_update_item (UPD_NROF, pl, this); 1545 esrv_update_item (UPD_NROF, pl, this);
1550 1546
1551 return true; 1547 return true;
1552 } 1548 }
1553 else 1549 else
1554 { 1550 {
1555 destroy (1); 1551 destroy ();
1556 return false; 1552 return false;
1557 } 1553 }
1558} 1554}
1559 1555
1560/* 1556/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines