… | |
… | |
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) |
… | |
… | |
522 | { |
523 | { |
523 | negate = 1; |
524 | negate = 1; |
524 | str++; |
525 | str++; |
525 | } |
526 | } |
526 | |
527 | |
527 | for (const flagstr *f = move_flags; f < move_flags + sizeof (move_flags) / sizeof (move_flags [0]); ++f) |
528 | for (const flagstr *f = move_flags; f < move_flags + array_length (move_flags); ++f) |
528 | { |
529 | { |
529 | if (!strcmp (f->name, str)) |
530 | if (!strcmp (f->name, str)) |
530 | { |
531 | { |
531 | if (negate) |
532 | if (negate) |
532 | mt &= ~f->flags; |
533 | mt &= ~f->flags; |
… | |
… | |
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, |
… | |
… | |
1506 | { |
1507 | { |
1507 | object_thawer f (filename); |
1508 | object_thawer f (filename); |
1508 | |
1509 | |
1509 | for (;;) |
1510 | for (;;) |
1510 | { |
1511 | { |
|
|
1512 | coroapi::cede_to_tick (); |
|
|
1513 | |
1511 | switch (f.kw) |
1514 | switch (f.kw) |
1512 | { |
1515 | { |
1513 | case KW_region: |
1516 | case KW_region: |
1514 | if (!region::read (f)) |
1517 | if (!region::read (f)) |
1515 | return false; |
1518 | return false; |