… | |
… | |
265 | type = 0; |
265 | type = 0; |
266 | } |
266 | } |
267 | |
267 | |
268 | switch (type) |
268 | switch (type) |
269 | { |
269 | { |
|
|
270 | case RANGED: |
270 | case BOW: |
271 | case BOW: |
271 | case WAND: |
272 | case WAND: |
272 | case ROD: |
273 | case ROD: |
273 | case HORN: |
274 | case HORN: |
274 | if (slot [body_range].info != -1) |
275 | if (slot [body_range].info != -1) |
… | |
… | |
1080 | |
1081 | |
1081 | archetype *arch = archetype::find (f.get_str ()); |
1082 | archetype *arch = archetype::find (f.get_str ()); |
1082 | |
1083 | |
1083 | if (!arch) |
1084 | if (!arch) |
1084 | { |
1085 | { |
1085 | LOG (llevError, "object refering to nonexistant archetype '%s'.\n", f.get_str ()); |
1086 | LOG (llevError, "object refering to nonexistent archetype '%s'.\n", f.get_str ()); |
1086 | arch = archetype::find (shstr_earthwall); |
1087 | arch = archetype::find (shstr_earthwall); |
1087 | } |
1088 | } |
1088 | |
1089 | |
1089 | assert (arch); //D maybe use exception handling of sorts? |
1090 | assert (arch); //D maybe use exception handling of sorts? |
1090 | |
1091 | |
… | |
… | |
1112 | * override values and in c_wiz to mutate values. |
1113 | * override values and in c_wiz to mutate values. |
1113 | */ |
1114 | */ |
1114 | int |
1115 | int |
1115 | set_variable (object *op, char *buf) |
1116 | set_variable (object *op, char *buf) |
1116 | { |
1117 | { |
1117 | object_thawer f (buf, (AV *)0); |
1118 | object_thawer f (format ("%s\nend", buf), (AV *)0); |
1118 | |
1119 | |
1119 | return op->parse_kv (f); |
1120 | return op->parse_kv (f); |
1120 | } |
1121 | } |
1121 | |
1122 | |
1122 | // compare *op against *arch and output differences |
1123 | // compare *op against *arch and output differences |
… | |
… | |
1464 | #endif |
1465 | #endif |
1465 | |
1466 | |
1466 | // save body locations. gcc's memcmp does an abysmal job when used |
1467 | // save body locations. gcc's memcmp does an abysmal job when used |
1467 | for (int i = 0; i < NUM_BODY_LOCATIONS; i++) |
1468 | for (int i = 0; i < NUM_BODY_LOCATIONS; i++) |
1468 | if (expect_false (op->slot[i].info != arch->slot[i].info)) |
1469 | if (expect_false (op->slot[i].info != arch->slot[i].info)) |
1469 | f.put (body_locations[i].save_name, op->slot[i].info); |
1470 | f.put (body_locations[i].kw, op->slot[i].info); |
1470 | } |
1471 | } |
1471 | |
1472 | |
1472 | /* |
1473 | /* |
1473 | * Dumps all variables in an object to a file. |
1474 | * Dumps all variables in an object to a file. |
1474 | * If bit 0 of flag is set, unpaid objects will be saved. As of now, |
1475 | * If bit 0 of flag is set, unpaid objects will be saved. As of now, |