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.126 by root, Thu Jan 1 11:41:17 2009 UTC vs.
Revision 1.130 by root, Wed Sep 16 23:22:50 2009 UTC

927 case KW_anim_speed: f.get (anim_speed); break; 927 case KW_anim_speed: f.get (anim_speed); break;
928 case KW_container: f.get (weight_limit); break; 928 case KW_container: f.get (weight_limit); break;
929 case KW_will_apply: f.get (will_apply); break; 929 case KW_will_apply: f.get (will_apply); break;
930 case KW_attack_movement: f.get (attack_movement); break; 930 case KW_attack_movement: f.get (attack_movement); break;
931 case KW_move_state: f.get (move_status); break; 931 case KW_move_state: f.get (move_status); break;
932 case KW_expmul: f.get (expmul); break; 932 //case KW_expmul: f.get (expmul); break;//D declared const for the time being
933 case KW_glow_radius: f.get (glow_radius); break; 933 case KW_glow_radius: f.get (glow_radius); break;
934 case KW_weapontype: f.get (weapontype); break; 934 case KW_weapontype: f.get (weapontype); break;
935 case KW_casting_time: f.get (casting_time); break; 935 case KW_casting_time: f.get (casting_time); break;
936 936
937 // elevation is deprecated 937 // elevation is deprecated
963 case KW_body_waist: slot[body_waist] .info = f.get_sint32 (); break; 963 case KW_body_waist: slot[body_waist] .info = f.get_sint32 (); break;
964 case KW_can_apply: 964 case KW_can_apply:
965 break; 965 break;
966 966
967 case KW_connected: 967 case KW_connected:
968 add_button_link (this, map, f.get_sint32 ()); 968 {
969 shstr connected;
970
971 f.get (connected);
972 add_link (map, connected);
973 }
969 break; 974 break;
970 975
971 case KW_randomitems: 976 case KW_randomitems:
972 if (f.get_str ()) 977 if (f.get_str ())
973 { 978 {
1310 if (op->face != tmp->face ) f.put (KW_face , op->face ? &faces [op->face ] : 0); 1315 if (op->face != tmp->face ) f.put (KW_face , op->face ? &faces [op->face ] : 0);
1311 if (op->sound != tmp->sound ) f.put (KW_sound , op->sound ? &faces [op->sound ] : 0); 1316 if (op->sound != tmp->sound ) f.put (KW_sound , op->sound ? &faces [op->sound ] : 0);
1312 if (op->sound_destroy != tmp->sound_destroy) f.put (KW_sound_destroy, op->sound_destroy ? &faces [op->sound_destroy] : 0); 1317 if (op->sound_destroy != tmp->sound_destroy) f.put (KW_sound_destroy, op->sound_destroy ? &faces [op->sound_destroy] : 0);
1313 1318
1314 if (op->animation_id != tmp->animation_id) 1319 if (op->animation_id != tmp->animation_id)
1315 if (op->animation_id) 1320 if (op->has_anim ())
1316 f.put (KW_animation, animations[GET_ANIM_ID (op)].name); 1321 f.put (KW_animation, op->anim ().name);
1317 else 1322 else
1318 { 1323 {
1319 f.put (KW_animation, (const char *)0); 1324 f.put (KW_animation, (const char *)0);
1320 op->flag [FLAG_ANIMATE] = false; // TODO: why force to false here? 1325 op->flag [FLAG_ANIMATE] = false; // TODO: why force to false here?
1321 } 1326 }
1378 CMP_OUT (last_grace); 1383 CMP_OUT (last_grace);
1379 CMP_OUT (last_eat); 1384 CMP_OUT (last_eat);
1380 CMP_OUT (glow_radius); 1385 CMP_OUT (glow_radius);
1381 1386
1382 if (op->flag [FLAG_IS_LINKED]) 1387 if (op->flag [FLAG_IS_LINKED])
1383 if (int i = get_button_value (op)) 1388 if (auto (ol, op->find_link ()))
1384 f.put (KW_connected, i); 1389 f.put (KW_connected, ol->id);
1385 1390
1386 CMP_OUT (randomitems); 1391 CMP_OUT (randomitems);
1387 CMP_OUT2 (container, weight_limit); 1392 CMP_OUT2 (container, weight_limit);
1388 1393
1389 CMP_OUT (run_away); 1394 CMP_OUT (run_away);
1425 * the only place this is not set is when saving the player. 1430 * the only place this is not set is when saving the player.
1426 */ 1431 */
1427bool 1432bool
1428object::write (object_freezer &f) 1433object::write (object_freezer &f)
1429{ 1434{
1430 archetype *at = arch ? arch : archetype::empty; 1435 if (is_arch ())
1431 1436 {
1437 f.put (KW_object, arch->archname);
1438 write_diff (f, this, archetype::empty);
1439 }
1440 else
1441 {
1432 f.put (KW_arch, at->archname); 1442 f.put (KW_arch, arch->archname);
1433 write_diff (f, this, at); 1443 write_diff (f, this, arch);
1444 }
1434 1445
1435 for (object *tmp = inv; tmp; tmp = tmp->below) 1446 for (object *tmp = inv; tmp; tmp = tmp->below)
1436 tmp->write (f); 1447 tmp->write (f);
1437 1448
1438 f.put (this); 1449 f.put (this);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines