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.237 by root, Tue May 6 21:04:37 2008 UTC vs.
Revision 1.242 by elmex, Wed May 7 21:00:02 2008 UTC

904 * drop on that space. 904 * drop on that space.
905 */ 905 */
906 if (!drop_to_ground 906 if (!drop_to_ground
907 || !map 907 || !map
908 || map->in_memory != MAP_ACTIVE 908 || map->in_memory != MAP_ACTIVE
909 || map->nodrop 909 || map->no_drop
910 || ms ().move_block == MOVE_ALL) 910 || ms ().move_block == MOVE_ALL)
911 { 911 {
912 while (inv) 912 while (inv)
913 { 913 {
914 inv->destroy_inv (false); 914 inv->destroy_inv (false);
943 943
944static struct freed_map : maptile 944static struct freed_map : maptile
945{ 945{
946 freed_map () 946 freed_map ()
947 { 947 {
948 path = "<freed objects map>"; 948 path = "<freed objects map>";
949 name = "/internal/freed_objects_map"; 949 name = "/internal/freed_objects_map";
950 width = 3; 950 width = 3;
951 height = 3; 951 height = 3;
952 nodrop = 1; 952 no_drop = 1;
953 no_reset = 1;
953 954
954 alloc (); 955 alloc ();
955 in_memory = MAP_ACTIVE; 956 in_memory = MAP_ACTIVE;
956 } 957 }
957 958
1309 if (!QUERY_FLAG (op, FLAG_ALIVE)) 1310 if (!QUERY_FLAG (op, FLAG_ALIVE))
1310 CLEAR_FLAG (op, FLAG_NO_STEAL); 1311 CLEAR_FLAG (op, FLAG_NO_STEAL);
1311 1312
1312 if (flag & INS_BELOW_ORIGINATOR) 1313 if (flag & INS_BELOW_ORIGINATOR)
1313 { 1314 {
1314 if (originator->map != op->map || originator->x != op->x || originator->y != op->y || !originator->is_on_map ()) 1315 if (originator->map != op->map || originator->x != op->x || originator->y != op->y)
1315 { 1316 {
1316 LOG (llevError, "insert_ob_in_map called with INS_BELOW_ORIGINATOR when originator not on same space!\n"); 1317 LOG (llevError, "insert_ob_in_map called with INS_BELOW_ORIGINATOR when originator not on same space!\n");
1317 abort (); 1318 abort ();
1318 } 1319 }
1320
1321 if (!originator->is_on_map ())
1322 LOG (llevDebug | logBacktrace, "insert_ob_in_map(%s) called with INS_BELOW_ORIGINATOR when originator '%s' not on map",
1323 op->debug_desc (), originator->debug_desc ());
1319 1324
1320 op->above = originator; 1325 op->above = originator;
1321 op->below = originator->below; 1326 op->below = originator->below;
1322 originator->below = op; 1327 originator->below = op;
1323 1328
1390 } /* If objects on this space */ 1395 } /* If objects on this space */
1391 1396
1392 if (flag & INS_ABOVE_FLOOR_ONLY) 1397 if (flag & INS_ABOVE_FLOOR_ONLY)
1393 top = floor; 1398 top = floor;
1394 1399
1395 /* Top is the object that our object (op) is going to get inserted above. 1400 // insert object above top, or bottom-most if top = 0
1396 */
1397
1398 /* no top found, insert on top */
1399 if (!top) 1401 if (!top)
1400 { 1402 {
1401 op->above = 0; 1403 op->below = 0;
1402 op->below = ms.top; 1404 op->above = ms.bot;
1403 ms.top = op; 1405 ms.bot = op;
1404 1406
1405 *(op->below ? &op->below->above : &ms.bot) = op; 1407 *(op->above ? &op->above->below : &ms.top) = op;
1406 } 1408 }
1407 else 1409 else
1408 { /* get inserted into the stack above top */ 1410 {
1409 op->above = top->above; 1411 op->above = top->above;
1410 top->above = op; 1412 top->above = op;
1411 1413
1412 op->below = top; 1414 op->below = top;
1413 *(op->above ? &op->above->below : &ms.top) = op; 1415 *(op->above ? &op->above->below : &ms.top) = op;
1414 } 1416 }
1415 } /* else not INS_BELOW_ORIGINATOR */ 1417 }
1416 1418
1417 if (op->type == PLAYER) 1419 if (op->type == PLAYER)
1418 { 1420 {
1419 op->contr->do_los = 1; 1421 op->contr->do_los = 1;
1420 ++op->map->players; 1422 ++op->map->players;
2415{ 2417{
2416 char flagdesc[512]; 2418 char flagdesc[512];
2417 char info2[256 * 4]; 2419 char info2[256 * 4];
2418 char *p = info; 2420 char *p = info;
2419 2421
2420 p += snprintf (p, 512, "{cnt:%d,uuid:%s,name:\"%s\"%s%s,flags:[%s],type:%d}", 2422 p += snprintf (p, 512, "{cnt:%d,uuid:%s,name:\"%s\"%s%s%s,flags:[%s],type:%d}",
2421 count, 2423 count,
2422 uuid.c_str (), 2424 uuid.c_str (),
2423 &name, 2425 &name,
2424 title ? "\",title:\"" : "", 2426 title ? ",title:\"" : "",
2425 title ? (const char *)title : "", 2427 title ? (const char *)title : "",
2428 title ? "\"" : "",
2426 flag_desc (flagdesc, 512), type); 2429 flag_desc (flagdesc, 512), type);
2427 2430
2428 if (!flag[FLAG_REMOVED] && env) 2431 if (!flag[FLAG_REMOVED] && env)
2429 p += snprintf (p, 256, "(in %s)", env->debug_desc (info2)); 2432 p += snprintf (p, 256, "(in %s)", env->debug_desc (info2));
2430 2433

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines