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.253 by root, Sun Aug 17 22:46:26 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;
769 || (QUERY_FLAG (op, FLAG_DAMNED) && !(m.flags_ & P_NO_CLERIC)) 770 || (QUERY_FLAG (op, FLAG_DAMNED) && !(m.flags_ & P_NO_CLERIC))
770 || (m.move_on | op->move_on ) != m.move_on 771 || (m.move_on | op->move_on ) != m.move_on
771 || (m.move_off | op->move_off ) != m.move_off 772 || (m.move_off | op->move_off ) != m.move_off
772 || (m.move_slow | op->move_slow) != m.move_slow 773 || (m.move_slow | op->move_slow) != m.move_slow
773 /* This isn't perfect, but I don't expect a lot of objects to 774 /* This isn't perfect, but I don't expect a lot of objects to
774 * to have move_allow right now. 775 * have move_allow right now.
775 */ 776 */
776 || ((m.move_block | op->move_block) & ~op->move_allow) != m.move_block 777 || ((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) 778 || 1) // the above is not strong enough a test to skip updating. los maybe? TODO (Schmorp)
778 m.flags_ = 0; 779 m.flags_ = 0;
779 } 780 }
909 || map->in_memory != MAP_ACTIVE 910 || map->in_memory != MAP_ACTIVE
910 || map->no_drop 911 || map->no_drop
911 || ms ().move_block == MOVE_ALL) 912 || ms ().move_block == MOVE_ALL)
912 { 913 {
913 while (inv) 914 while (inv)
914 {
915 inv->destroy_inv (false);
916 inv->destroy (); 915 inv->destroy (true);
917 }
918 } 916 }
919 else 917 else
920 { /* Put objects in inventory onto this space */ 918 { /* Put objects in inventory onto this space */
921 while (inv) 919 while (inv)
922 { 920 {
1117 *(below ? &below->above : &ms.bot) = above; 1115 *(below ? &below->above : &ms.bot) = above;
1118 1116
1119 above = 0; 1117 above = 0;
1120 below = 0; 1118 below = 0;
1121 1119
1120 ms.flags_ = 0;
1121
1122 if (map->in_memory == MAP_SAVING) 1122 if (map->in_memory == MAP_SAVING)
1123 return; 1123 return;
1124 1124
1125 int check_walk_off = !flag [FLAG_NO_APPLY]; 1125 int check_walk_off = !flag [FLAG_NO_APPLY];
1126 1126
1157 LOG (llevError, "BUG: remove_ob(): name %s, destroyed leaving object\n", tmp->debug_desc ()); 1157 LOG (llevError, "BUG: remove_ob(): name %s, destroyed leaving object\n", tmp->debug_desc ());
1158 } 1158 }
1159 1159
1160 last = tmp; 1160 last = tmp;
1161 } 1161 }
1162
1163 /* last == NULL if there are no objects on this space */
1164 //TODO: this makes little sense, why only update the topmost object?
1165 if (!last)
1166 map->at (x, y).flags_ = 0;
1167 else
1168 update_object (last, UP_OBJ_REMOVE);
1169 1162
1170 if (flag [FLAG_BLOCKSVIEW] || glow_radius) 1163 if (flag [FLAG_BLOCKSVIEW] || glow_radius)
1171 update_all_los (map, x, y); 1164 update_all_los (map, x, y);
1172 } 1165 }
1173} 1166}
1537 if (!nr) 1530 if (!nr)
1538 return true; 1531 return true;
1539 1532
1540 nr = min (nr, nrof); 1533 nr = min (nr, nrof);
1541 1534
1535 if (nrof > nr)
1536 {
1542 nrof -= nr; 1537 nrof -= nr;
1543
1544 if (nrof)
1545 {
1546 adjust_weight (env, -weight * max (1, nr)); // carrying == 0 1538 adjust_weight (env, -weight * max (1, nr)); // carrying == 0
1547 1539
1548 if (object *pl = visible_to ()) 1540 if (object *pl = visible_to ())
1549 esrv_update_item (UPD_NROF, pl, this); 1541 esrv_update_item (UPD_NROF, pl, this);
1550 1542
1551 return true; 1543 return true;
1552 } 1544 }
1553 else 1545 else
1554 { 1546 {
1555 destroy (1); 1547 destroy ();
1556 return false; 1548 return false;
1557 } 1549 }
1558} 1550}
1559 1551
1560/* 1552/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines