… | |
… | |
971 | f.next (); |
971 | f.next (); |
972 | } |
972 | } |
973 | } |
973 | } |
974 | |
974 | |
975 | object * |
975 | object * |
976 | object::read (object_thawer &f) |
976 | object::read (object_thawer &f, maptile *map) |
977 | { |
977 | { |
978 | assert (f.kw == KW_arch); |
978 | assert (f.kw == KW_arch); |
979 | |
979 | |
980 | archetype *arch = archetype::find (f.get_str ()); |
980 | archetype *arch = archetype::find (f.get_str ()); |
|
|
981 | |
|
|
982 | if (!arch) |
|
|
983 | { |
|
|
984 | LOG (llevError, "object refering to nonexistant archetype '%s'.\n", f.get_str ()); |
|
|
985 | arch = archetype::find ("earthwall"); |
|
|
986 | } |
|
|
987 | |
981 | assert (arch); //D maybe use exception handling of sorts? |
988 | assert (arch); //D maybe use exception handling of sorts? |
982 | |
989 | |
983 | object *op = object::create (); |
990 | object *op = object::create (); |
984 | |
991 | |
|
|
992 | op->map = map; |
985 | op->arch = arch; |
993 | op->arch = arch; |
986 | arch->clone.copy_to (op); |
994 | arch->clone.copy_to (op); |
987 | // copy_to activates, this should be fixed properly |
995 | // copy_to activates, this should be fixed properly |
988 | op->deactivate (); |
996 | op->deactivate (); |
989 | |
997 | |
… | |
… | |
1005 | int |
1013 | int |
1006 | set_variable (object *op, char *buf) |
1014 | set_variable (object *op, char *buf) |
1007 | { |
1015 | { |
1008 | object_thawer f (buf, (AV *)0); |
1016 | object_thawer f (buf, (AV *)0); |
1009 | |
1017 | |
|
|
1018 | f.kw = KW_arch; // special hack so that parse_kv skips |
1010 | return op->parse_kv (f); |
1019 | return op->parse_kv (f); |
1011 | } |
1020 | } |
1012 | |
1021 | |
1013 | /* This returns a string of the integer movement type */ |
1022 | /* This returns a string of the integer movement type */ |
1014 | #if 0 |
1023 | #if 0 |