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

Comparing deliantra/server/common/loader.C (file contents):
Revision 1.154 by root, Sun Apr 11 01:35:51 2010 UTC vs.
Revision 1.159 by root, Thu May 6 22:57:48 2010 UTC

394 if (ip > 2 * item_power && ip > (item_power + 3)) 394 if (ip > 2 * item_power && ip > (item_power + 3))
395 LOG (llevDebug, "Object %s seems to have too low item power? %d > %d\n", debug_desc (), ip, item_power); 395 LOG (llevDebug, "Object %s seems to have too low item power? %d > %d\n", debug_desc (), ip, item_power);
396#endif 396#endif
397 } 397 }
398 398
399 /* old style spellcasting object (pretty common) - need to load in the appropiate object */ 399 /* old style spellcasting object (pretty common) - need to load in the appropriate object */
400 /* (schmorp) old really doesn't mean old, imho, just a more compact way to store such objects */ 400 /* (schmorp) old really doesn't mean old, imho, just a more compact way to store such objects */
401 if ((type == ROD 401 if ((type == ROD
402 || type == WAND 402 || type == WAND
403 || type == SCROLL 403 || type == SCROLL
404 || type == HORN 404 || type == HORN
522 { 522 {
523 negate = 1; 523 negate = 1;
524 str++; 524 str++;
525 } 525 }
526 526
527 for (const flagstr *f = move_flags; f < move_flags + sizeof (move_flags) / sizeof (move_flags [0]); ++f) 527 for (const flagstr *f = move_flags; f < move_flags + array_length (move_flags); ++f)
528 { 528 {
529 if (!strcmp (f->name, str)) 529 if (!strcmp (f->name, str))
530 { 530 {
531 if (negate) 531 if (negate)
532 mt &= ~f->flags; 532 mt &= ~f->flags;
736 case KW_invisible: f.get (invisible); break; 736 case KW_invisible: f.get (invisible); break;
737 case KW_magic: f.get (magic); break; 737 case KW_magic: f.get (magic); break;
738 case KW_state: f.get (state); break; 738 case KW_state: f.get (state); break;
739 case KW_move_slow_penalty: f.get (move_slow_penalty); break; 739 case KW_move_slow_penalty: f.get (move_slow_penalty); break;
740 case KW_material: f.get (materials); break; //TODO: nuke 740 case KW_material: f.get (materials); break; //TODO: nuke
741 741 case KW_materialname: f.get (material); break;
742 case KW_materialname:
743 {
744 shstr sh;
745 f.get (sh);
746 material = name_to_material (sh);
747 }
748 break;
749 742
750 /* These are the new values */ 743 /* These are the new values */
751 case KW_move_block: set_move (move_block, f); break; 744 case KW_move_block: set_move (move_block, f); break;
752 case KW_move_allow: set_move (move_allow, f); break; 745 case KW_move_allow: set_move (move_allow, f); break;
753 case KW_move_type: set_move (move_type , f); break; 746 case KW_move_type: set_move (move_type , f); break;
1451 CMP_OUT (move_slow); 1444 CMP_OUT (move_slow);
1452 CMP_OUT (move_slow_penalty); 1445 CMP_OUT (move_slow_penalty);
1453 1446
1454 object::flags_t diff = (op->flag ^ arch->flag) & flagmask; 1447 object::flags_t diff = (op->flag ^ arch->flag) & flagmask;
1455 1448
1449#if stdcpp // we need gcc, sorry
1456 if (diff [FLAG_OBJ_ORIGINAL]) 1450 if (diff [FLAG_OBJ_ORIGINAL])
1457 f.put (flag_names [FLAG_OBJ_ORIGINAL], op->flag [FLAG_OBJ_ORIGINAL] ? CS(1) : CS(0)); 1451 f.put (flag_names [FLAG_OBJ_ORIGINAL], op->flag [FLAG_OBJ_ORIGINAL] ? CS(1) : CS(0));
1458 1452
1459 diff.reset (FLAG_OBJ_ORIGINAL); 1453 diff.reset (FLAG_OBJ_ORIGINAL);
1460 1454
1461 // quickly test whether any other flags differ 1455 // quickly test whether any other flags differ
1462 if (expect_true (diff.any ())) 1456 if (expect_true (diff.any ()))
1463 for (int i = 0; i < NUM_FLAGS; i++) 1457 for (int i = 0; i < NUM_FLAGS; i++)
1464 if (expect_false (diff [i])) 1458 if (expect_false (diff [i]))
1465 f.put (flag_names [i], op->flag [i] ? CS(1) : CS(0)); 1459 f.put (flag_names [i], op->flag [i] ? CS(1) : CS(0));
1460#else
1461 // use sgi extensions
1462 for (int i = diff._Find_first (); i < diff.size (); i = diff._Find_next (i))
1463 f.put (flag_names [i], op->flag [i] ? CS(1) : CS(0));
1464#endif
1466 1465
1467 // save body locations. gcc's memcmp does an abysmal job when used 1466 // save body locations. gcc's memcmp does an abysmal job when used
1468 for (int i = 0; i < NUM_BODY_LOCATIONS; i++) 1467 for (int i = 0; i < NUM_BODY_LOCATIONS; i++)
1469 if (expect_false (op->slot[i].info != arch->slot[i].info)) 1468 if (expect_false (op->slot[i].info != arch->slot[i].info))
1470 f.put (body_locations[i].save_name, op->slot[i].info); 1469 f.put (body_locations[i].save_name, op->slot[i].info);
1507{ 1506{
1508 object_thawer f (filename); 1507 object_thawer f (filename);
1509 1508
1510 for (;;) 1509 for (;;)
1511 { 1510 {
1511 coroapi.cede_to_tick ();
1512
1512 switch (f.kw) 1513 switch (f.kw)
1513 { 1514 {
1514 case KW_region: 1515 case KW_region:
1515 if (!region::read (f)) 1516 if (!region::read (f))
1516 return false; 1517 return false;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines