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.143 by root, Mon Nov 9 19:17:58 2009 UTC vs.
Revision 1.146 by root, Wed Nov 11 04:45:22 2009 UTC

330 330
331 if (!name_pl) 331 if (!name_pl)
332 name_pl = name; 332 name_pl = name;
333 333
334 /* objects now have a materialname. try to patch it in */ 334 /* objects now have a materialname. try to patch it in */
335 if (!(is_weapon () && level > 0)) 335 if (material == MATERIAL_NULL && !(is_weapon () && level > 0))
336 set_materialname (this, map ? map->difficulty : 5, 0); 336 select_material (this, map ? map->difficulty : 5);
337 337
338 /* only do these when program is first run - a bit 338 /* only do these when program is first run - a bit
339 * excessive to do this at every run - most of this is 339 * excessive to do this at every run - most of this is
340 * really just to catch any errors - program will still run, but 340 * really just to catch any errors - program will still run, but
341 * not in the ideal fashion. 341 * not in the ideal fashion.
725 case KW_invisible: f.get (invisible); break; 725 case KW_invisible: f.get (invisible); break;
726 case KW_magic: f.get (magic); break; 726 case KW_magic: f.get (magic); break;
727 case KW_state: f.get (state); break; 727 case KW_state: f.get (state); break;
728 case KW_move_slow_penalty: f.get (move_slow_penalty); break; 728 case KW_move_slow_penalty: f.get (move_slow_penalty); break;
729 case KW_material: f.get (materials); break; //TODO: nuke 729 case KW_material: f.get (materials); break; //TODO: nuke
730 case KW_materialname: f.get (materialname); break; 730
731 case KW_materialname:
732 {
733 shstr sh;
734 f.get (sh);
735 material = name_to_material (sh);
736 }
737 break;
731 738
732 /* These are the new values */ 739 /* These are the new values */
733 case KW_move_block: set_move (move_block, f.get_str ()); break; 740 case KW_move_block: set_move (move_block, f.get_str ()); break;
734 case KW_move_allow: set_move (move_allow, f.get_str ()); break; 741 case KW_move_allow: set_move (move_allow, f.get_str ()); break;
735 case KW_move_type: set_move (move_type, f.get_str ()); break; 742 case KW_move_type: set_move (move_type, f.get_str ()); break;
852 case KW_reflect_missile: GET_FLAG (this, FLAG_REFL_MISSILE); break; 859 case KW_reflect_missile: GET_FLAG (this, FLAG_REFL_MISSILE); break;
853 case KW_reflect_spell: GET_FLAG (this, FLAG_REFL_SPELL); break; 860 case KW_reflect_spell: GET_FLAG (this, FLAG_REFL_SPELL); break;
854 case KW_no_magic: GET_FLAG (this, FLAG_NO_MAGIC); break; 861 case KW_no_magic: GET_FLAG (this, FLAG_NO_MAGIC); break;
855 case KW_no_drop: GET_FLAG (this, FLAG_NO_DROP); break; 862 case KW_no_drop: GET_FLAG (this, FLAG_NO_DROP); break;
856 case KW_random_movement: GET_FLAG (this, FLAG_RANDOM_MOVE); break; 863 case KW_random_movement: GET_FLAG (this, FLAG_RANDOM_MOVE); break;
857 case KW_no_fix_player: GET_FLAG (this, FLAG_NO_FIX_PLAYER); break;
858 case KW_is_lightable: GET_FLAG (this, FLAG_IS_LIGHTABLE); break; 864 case KW_is_lightable: GET_FLAG (this, FLAG_IS_LIGHTABLE); break;
859 case KW_tear_down: GET_FLAG (this, FLAG_TEAR_DOWN); break; 865 case KW_tear_down: GET_FLAG (this, FLAG_TEAR_DOWN); break;
860 case KW_can_use_shield: GET_FLAG (this, FLAG_USE_SHIELD); break; 866 case KW_can_use_shield: GET_FLAG (this, FLAG_USE_SHIELD); break;
861 case KW_can_cast_spell: GET_FLAG (this, FLAG_CAST_SPELL); break; 867 case KW_can_cast_spell: GET_FLAG (this, FLAG_CAST_SPELL); break;
862 case KW_can_use_scroll: GET_FLAG (this, FLAG_USE_SCROLL); break; 868 case KW_can_use_scroll: GET_FLAG (this, FLAG_USE_SCROLL); break;
1168 KW_unaggressive, 1174 KW_unaggressive,
1169 KW_reflect_missile, 1175 KW_reflect_missile,
1170 /* 40 */ 1176 /* 40 */
1171 KW_reflect_spell, 1177 KW_reflect_spell,
1172 KW_no_magic, 1178 KW_no_magic,
1173 KW_no_fix_player, 1179 KW_NULL,
1174 KW_is_lightable, 1180 KW_is_lightable,
1175 KW_tear_down, 1181 KW_tear_down,
1176 KW_run_away, 1182 KW_run_away,
1177 KW_NULL, // pass_thru 1183 KW_NULL, // pass_thru
1178 KW_NULL, // an_pass_thru 1184 KW_NULL, // an_pass_thru
1359 CMP_OUT (attack_movement); 1365 CMP_OUT (attack_movement);
1360 CMP_OUT (nrof); 1366 CMP_OUT (nrof);
1361 CMP_OUT (level); 1367 CMP_OUT (level);
1362 CMP_OUT (attacktype); 1368 CMP_OUT (attacktype);
1363 1369
1364 // using memcmp here seems to be a loss - us gcc vectorising? 1370 // using memcmp here seems to be a loss - is gcc vectorising?
1365 for (int i = 0; i < NROFATTACKS; i++) 1371 for (int i = 0; i < NROFATTACKS; i++)
1366 if (expect_false (op->resist[i] != arch->resist[i])) 1372 if (expect_false (op->resist[i] != arch->resist[i]))
1367 f.put (resist_save[i], op->resist[i]); 1373 f.put (resist_save[i], op->resist[i]);
1368 1374
1369 CMP_OUT (path_attuned); 1375 CMP_OUT (path_attuned);
1370 CMP_OUT (path_repelled); 1376 CMP_OUT (path_repelled);
1371 CMP_OUT (path_denied); 1377 CMP_OUT (path_denied);
1378
1372 CMP_OUT2 (material, materials);//TODO: nuke 1379 CMP_OUT2 (material, materials);//TODO: nuke
1373 CMP_OUT (materialname); 1380 if (op->material != arch->material)
1381 f.put (KW_materialname, op->material->name);
1382
1374 CMP_OUT (value); 1383 CMP_OUT (value);
1375 CMP_OUT (carrying); 1384 CMP_OUT (carrying);
1376 CMP_OUT (weight); 1385 CMP_OUT (weight);
1377 CMP_OUT (invisible); 1386 CMP_OUT (invisible);
1378 CMP_OUT (state); 1387 CMP_OUT (state);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines