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.72 by root, Sat Apr 21 12:28:31 2007 UTC vs.
Revision 1.76 by root, Mon May 7 03:05:58 2007 UTC

1/* 1/*
2 * CrossFire, A Multiplayer game for X-windows 2 * CrossFire, A Multiplayer game
3 * 3 *
4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team 4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
5 * Copyright (C) 2002 Mark Wedel & Crossfire Development Team 5 * Copyright (C) 2002 Mark Wedel & Crossfire Development Team
6 * Copyright (C) 1992 Frank Tore Johansen 6 * Copyright (C) 1992 Frank Tore Johansen
7 * 7 *
293 */ 293 */
294 if ((op->type == WEAPON || op->type == BOW) && loading_arch) 294 if ((op->type == WEAPON || op->type == BOW) && loading_arch)
295 { 295 {
296 if (!op->skill) 296 if (!op->skill)
297 LOG (llevError, "Weapon %s lacks a skill.\n", op->debug_desc ()); 297 LOG (llevError, "Weapon %s lacks a skill.\n", op->debug_desc ());
298 else if ((!strcmp (op->skill, "one handed weapons") && op->body_info[1] != -1) || 298 else if ((!strcmp (op->skill, "one handed weapons") && op->slot[1].info != -1) ||
299 (!strcmp (op->skill, "two handed weapons") && op->body_info[1] != -2)) 299 (!strcmp (op->skill, "two handed weapons") && op->slot[1].info != -2))
300 LOG (llevError, "weapon %s arm usage does not match skill: %d, %s\n", op->debug_desc (), op->body_info[1], &op->skill); 300 LOG (llevError, "weapon %s arm usage does not match skill: %d, %s\n", op->debug_desc (), op->slot[1].info, &op->skill);
301 } 301 }
302 302
303 /* We changed last_heal to gen_sp_armour, which is what it 303 /* We changed last_heal to gen_sp_armour, which is what it
304 * really does for many objects. Need to catch any in maps 304 * really does for many objects. Need to catch any in maps
305 * that may have an old value. 305 * that may have an old value.
833 case KW_no_steal: GET_FLAG (this, FLAG_NO_STEAL); break; 833 case KW_no_steal: GET_FLAG (this, FLAG_NO_STEAL); break;
834 case KW_one_hit: GET_FLAG (this, FLAG_ONE_HIT); break; 834 case KW_one_hit: GET_FLAG (this, FLAG_ONE_HIT); break;
835 case KW_berserk: GET_FLAG (this, FLAG_BERSERK); break; 835 case KW_berserk: GET_FLAG (this, FLAG_BERSERK); break;
836 case KW_is_buildable: GET_FLAG (this, FLAG_IS_BUILDABLE); break; 836 case KW_is_buildable: GET_FLAG (this, FLAG_IS_BUILDABLE); break;
837 case KW_destroy_on_death: GET_FLAG (this, FLAG_DESTROY_ON_DEATH); break; 837 case KW_destroy_on_death: GET_FLAG (this, FLAG_DESTROY_ON_DEATH); break;
838 case KW_treasure_env: GET_FLAG (this, FLAG_TREASURE_ENV); break;
839 case KW_precious: GET_FLAG (this, FLAG_PRECIOUS); break;
838 840
839 case KW_armour: f.get (resist[ATNR_PHYSICAL]); break; 841 case KW_armour: f.get (resist[ATNR_PHYSICAL]); break;
840 case KW_resist_physical: f.get (resist[ATNR_PHYSICAL]); break; 842 case KW_resist_physical: f.get (resist[ATNR_PHYSICAL]); break;
841 case KW_resist_magic: f.get (resist[ATNR_MAGIC]); break; 843 case KW_resist_magic: f.get (resist[ATNR_MAGIC]); break;
842 case KW_resist_fire: f.get (resist[ATNR_FIRE]); break; 844 case KW_resist_fire: f.get (resist[ATNR_FIRE]); break;
888 case KW_dam_modifier: f.get (dam_modifier); break; 890 case KW_dam_modifier: f.get (dam_modifier); break;
889 case KW_duration_modifier: f.get (duration_modifier); break; 891 case KW_duration_modifier: f.get (duration_modifier); break;
890 892
891 //TODO: mechanism to ensure that KW_xxx is consecutive needed from include/preprocess 893 //TODO: mechanism to ensure that KW_xxx is consecutive needed from include/preprocess
892 //TODO: parse from other include files 894 //TODO: parse from other include files
893 case KW_body_range: f.get (body_info[0]); break; 895 case KW_body_range: slot[ 0].info = f.get_sint32 (); break;
894 case KW_body_arm: f.get (body_info[1]); break; 896 case KW_body_arm: slot[ 1].info = f.get_sint32 (); break;
895 case KW_body_torso: f.get (body_info[2]); break; 897 case KW_body_torso: slot[ 2].info = f.get_sint32 (); break;
896 case KW_body_head: f.get (body_info[3]); break; 898 case KW_body_head: slot[ 3].info = f.get_sint32 (); break;
897 case KW_body_neck: f.get (body_info[4]); break; 899 case KW_body_neck: slot[ 4].info = f.get_sint32 (); break;
898 case KW_body_skill: f.get (body_info[5]); break; 900 case KW_body_skill: slot[ 5].info = f.get_sint32 (); break;
899 case KW_body_finger: f.get (body_info[6]); break; 901 case KW_body_finger: slot[ 6].info = f.get_sint32 (); break;
900 case KW_body_shoulder: f.get (body_info[7]); break; 902 case KW_body_shoulder: slot[ 7].info = f.get_sint32 (); break;
901 case KW_body_foot: f.get (body_info[8]); break; 903 case KW_body_foot: slot[ 8].info = f.get_sint32 (); break;
902 case KW_body_hand: f.get (body_info[9]); break; 904 case KW_body_hand: slot[ 9].info = f.get_sint32 (); break;
903 case KW_body_wrist: f.get (body_info[10]); break; 905 case KW_body_wrist: slot[10].info = f.get_sint32 (); break;
904 case KW_body_waist: f.get (body_info[11]); break; 906 case KW_body_waist: slot[11].info = f.get_sint32 (); break;
905 case KW_can_apply: 907 case KW_can_apply:
906 break; 908 break;
907 909
908 case KW_connected: 910 case KW_connected:
909 add_button_link (this, map, f.get_sint32 ()); 911 add_button_link (this, map, f.get_sint32 ());
918 : treasurelist::find (f.get_str ()); 920 : treasurelist::find (f.get_str ());
919 921
920 if (!randomitems) 922 if (!randomitems)
921 LOG (llevError, "%s uses unknown randomitems '%s'.\n", debug_desc (), f.get_str ()); 923 LOG (llevError, "%s uses unknown randomitems '%s'.\n", debug_desc (), f.get_str ());
922 } 924 }
925 else
926 randomitems = 0;
923 break; 927 break;
924 928
925 case KW_msg: 929 case KW_msg:
926 f.get_ml (KW_endmsg, msg); 930 f.get_ml (KW_endmsg, msg);
927 //TODO: allow longer messages 931 //TODO: allow longer messages
1104 KW_monster, 1108 KW_monster,
1105 KW_friendly, 1109 KW_friendly,
1106 KW_generator, 1110 KW_generator,
1107 KW_is_thrown, 1111 KW_is_thrown,
1108 KW_auto_apply, 1112 KW_auto_apply,
1109 KW_NULL, // was KW_treasure 1113 KW_treasure_env,
1110 KW_player_sold, 1114 KW_player_sold,
1111 /* 20 */ 1115 /* 20 */
1112 KW_see_invisible, 1116 KW_see_invisible,
1113 KW_can_roll, 1117 KW_can_roll,
1114 KW_overlay_floor, 1118 KW_overlay_floor,
1175 KW_can_use_skill, 1179 KW_can_use_skill,
1176 KW_been_applied, 1180 KW_been_applied,
1177 /* 80 */ 1181 /* 80 */
1178 KW_has_ready_scroll, 1182 KW_has_ready_scroll,
1179 KW_can_use_rod, 1183 KW_can_use_rod,
1180 KW_NULL, 1184 KW_precious,
1181 KW_can_use_horn, 1185 KW_can_use_horn,
1182 KW_make_invisible, 1186 KW_make_invisible,
1183 KW_inv_locked, 1187 KW_inv_locked,
1184 KW_is_wooded, 1188 KW_is_wooded,
1185 KW_is_hilly, 1189 KW_is_hilly,
1361 if (flag_names [i] && op->flag [i] != tmp->flag [i]) 1365 if (flag_names [i] && op->flag [i] != tmp->flag [i])
1362 f.put (flag_names [i], op->flag [i] ? "1" : "0"); 1366 f.put (flag_names [i], op->flag [i] ? "1" : "0");
1363 1367
1364 /* Save body locations */ 1368 /* Save body locations */
1365 for (i = 0; i < NUM_BODY_LOCATIONS; i++) 1369 for (i = 0; i < NUM_BODY_LOCATIONS; i++)
1366 if (op->body_info[i] != tmp->body_info[i]) 1370 if (op->slot[i].info != tmp->slot[i].info)
1367 f.put (body_locations[i].save_name, op->body_info[i]); 1371 f.put (body_locations[i].save_name, op->slot[i].info);
1368} 1372}
1369 1373
1370/* 1374/*
1371 * Dumps all variables in an object to a file. 1375 * Dumps all variables in an object to a file.
1372 * If bit 0 of flag is set, unpaid objects will be saved. As of now, 1376 * If bit 0 of flag is set, unpaid objects will be saved. As of now,
1434 goto finish; 1438 goto finish;
1435 1439
1436 default: 1440 default:
1437 if (!f.parse_error ("resource file")) 1441 if (!f.parse_error ("resource file"))
1438 goto finish; 1442 goto finish;
1443
1444 f.next ();
1445 break;
1439 } 1446 }
1440 } 1447 }
1441 1448
1442finish: 1449finish:
1443 if (seen_arch) 1450 if (seen_arch)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines