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.182 by root, Wed Nov 14 21:19:41 2018 UTC vs.
Revision 1.185 by root, Wed Dec 5 19:03:26 2018 UTC

530 { 530 {
531 negate = 1; 531 negate = 1;
532 str++; 532 str++;
533 } 533 }
534 534
535 for (const flagstr *f = move_flags; f < move_flags + array_length (move_flags); ++f) 535 for (const flagstr *f = move_flags; f < move_flags + ecb_array_length (move_flags); ++f)
536 { 536 {
537 if (!strcmp (f->name, str)) 537 if (!strcmp (f->name, str))
538 { 538 {
539 if (negate) 539 if (negate)
540 mt &= ~f->flags; 540 mt &= ~f->flags;
1224 *ptr++ = '\n'; 1224 *ptr++ = '\n';
1225 1225
1226 f.alloc (ptr - cur); 1226 f.alloc (ptr - cur);
1227 } 1227 }
1228 1228
1229#define CMP_OUT(v) if (expect_false (op->v != arch->v)) f.put (KW (v), op->v) 1229#define CMP_OUT(v) if (ecb_expect_false (op->v != arch->v)) f.put (KW (v), op->v)
1230#define CMP_OUT2(k,v) if (expect_false (op->v != arch->v)) f.put (KW (k), op->v) 1230#define CMP_OUT2(k,v) if (ecb_expect_false (op->v != arch->v)) f.put (KW (k), op->v)
1231 1231
1232 CMP_OUT (x); 1232 CMP_OUT (x);
1233 CMP_OUT (y); 1233 CMP_OUT (y);
1234 1234
1235 CMP_OUT (type); 1235 CMP_OUT (type);
1324 CMP_OUT (level); 1324 CMP_OUT (level);
1325 CMP_OUT (attacktype); 1325 CMP_OUT (attacktype);
1326 1326
1327 // using memcmp here seems to be a loss - is gcc vectorising? 1327 // using memcmp here seems to be a loss - is gcc vectorising?
1328 for (int i = 0; i < NROFATTACKS; i++) 1328 for (int i = 0; i < NROFATTACKS; i++)
1329 if (expect_false (op->resist[i] != arch->resist[i])) 1329 if (ecb_expect_false (op->resist[i] != arch->resist[i]))
1330 f.put (resist_save[i], op->resist[i]); 1330 f.put (resist_save[i], op->resist[i]);
1331 1331
1332 CMP_OUT (path_attuned); 1332 CMP_OUT (path_attuned);
1333 CMP_OUT (path_repelled); 1333 CMP_OUT (path_repelled);
1334 CMP_OUT (path_denied); 1334 CMP_OUT (path_denied);
1348 CMP_OUT (last_grace); 1348 CMP_OUT (last_grace);
1349 CMP_OUT (last_eat); 1349 CMP_OUT (last_eat);
1350 CMP_OUT (glow_radius); 1350 CMP_OUT (glow_radius);
1351 1351
1352 if (op->flag [FLAG_IS_LINKED]) 1352 if (op->flag [FLAG_IS_LINKED])
1353 if (auto (ol, op->find_link ())) 1353 if (auto ol = op->find_link ())
1354 f.put (KW(connected), ol->id); 1354 f.put (KW(connected), ol->id);
1355 1355
1356 CMP_OUT (randomitems); 1356 CMP_OUT (randomitems);
1357 1357
1358 CMP_OUT2 (container, weight_limit); 1358 CMP_OUT2 (container, weight_limit);
1386 f.put (flag_names [FLAG_OBJ_ORIGINAL], op->flag [FLAG_OBJ_ORIGINAL] ? CS(1) : CS(0)); 1386 f.put (flag_names [FLAG_OBJ_ORIGINAL], op->flag [FLAG_OBJ_ORIGINAL] ? CS(1) : CS(0));
1387 1387
1388 diff.reset (FLAG_OBJ_ORIGINAL); 1388 diff.reset (FLAG_OBJ_ORIGINAL);
1389 1389
1390 // quickly test whether any other flags differ 1390 // quickly test whether any other flags differ
1391 if (expect_true (diff.any ())) 1391 if (ecb_expect_true (diff.any ()))
1392 for (int i = 0; i < NUM_FLAGS; i++) 1392 for (int i = 0; i < NUM_FLAGS; i++)
1393 if (expect_false (diff [i])) 1393 if (ecb_expect_false (diff [i]))
1394 f.put (flag_names [i], op->flag [i] ? CS(1) : CS(0)); 1394 f.put (flag_names [i], op->flag [i] ? CS(1) : CS(0));
1395#else 1395#else
1396 // use sgi extensions 1396 // use sgi extensions
1397 for (int i = diff._Find_first (); i < diff.size (); i = diff._Find_next (i)) 1397 for (int i = diff._Find_first (); i < diff.size (); i = diff._Find_next (i))
1398 f.put (flag_names [i], op->flag [i] ? CS(1) : CS(0)); 1398 f.put (flag_names [i], op->flag [i] ? CS(1) : CS(0));
1399#endif 1399#endif
1400 1400
1401 // save body locations. gcc's memcmp does an abysmal job when used 1401 // save body locations. gcc's memcmp does an abysmal job when used
1402 for (int i = 0; i < NUM_BODY_LOCATIONS; i++) 1402 for (int i = 0; i < NUM_BODY_LOCATIONS; ++i)
1403 if (expect_false (op->slot[i].info != arch->slot[i].info)) 1403 if (ecb_expect_false (op->slot[i].info != arch->slot[i].info))
1404 f.put (body_locations[i].kw, op->slot[i].info); 1404 f.put (body_locations[i].kw, op->slot[i].info);
1405} 1405}
1406 1406
1407/* 1407/*
1408 * Dumps all variables in an object to a file. 1408 * Dumps all variables in an object to a file.
1410 * the only place this is not set is when saving the player. 1410 * the only place this is not set is when saving the player.
1411 */ 1411 */
1412bool 1412bool
1413object::write (object_freezer &f) 1413object::write (object_freezer &f)
1414{ 1414{
1415 if (expect_false (is_arch ())) 1415 if (ecb_expect_false (is_arch ()))
1416 { 1416 {
1417 f.put (KW(object), arch->archname); 1417 f.put (KW(object), arch->archname);
1418 write_diff (f, this, archetype::empty); 1418 write_diff (f, this, archetype::empty);
1419 } 1419 }
1420 else 1420 else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines