… | |
… | |
540 | case KW_slaying: thawer.get_ornull (op->slaying); break; |
540 | case KW_slaying: thawer.get_ornull (op->slaying); break; |
541 | |
541 | |
542 | case KW_arch: |
542 | case KW_arch: |
543 | { |
543 | { |
544 | const char *str = thawer.get_str (); |
544 | const char *str = thawer.get_str (); |
545 | fprintf (stderr, "arch %s\n", str);//D |
|
|
546 | |
545 | |
547 | if (op->arch) |
546 | if (op->arch) |
548 | { |
547 | { |
549 | /* If op->arch has been set, then this new object |
548 | /* If op->arch has been set, then this new object |
550 | * must be part of the inventory. So process |
549 | * must be part of the inventory. So process |
… | |
… | |
1058 | * |
1057 | * |
1059 | */ |
1058 | */ |
1060 | int |
1059 | int |
1061 | load_object (object_thawer &fp, object *op, int map_flags) |
1060 | load_object (object_thawer &fp, object *op, int map_flags) |
1062 | { |
1061 | { |
1063 | // cede every 500 objects loaded |
1062 | coroapi::cede_every (1000); // cede once in a while |
1064 | { |
|
|
1065 | static int cede_counter = 0; |
|
|
1066 | |
|
|
1067 | if (++cede_counter >= 500) |
|
|
1068 | { |
|
|
1069 | cede_counter = 0; |
|
|
1070 | if (coroapi::nready ()) |
|
|
1071 | coroapi::cede (); |
|
|
1072 | } |
|
|
1073 | } |
|
|
1074 | |
1063 | |
1075 | return parse_object (op, fp, map_flags); |
1064 | return parse_object (op, fp, map_flags); |
1076 | } |
1065 | } |
1077 | |
1066 | |
1078 | /* This takes a buffer, scans it for variables, and sets those variables |
1067 | /* This takes a buffer, scans it for variables, and sets those variables |