… | |
… | |
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 |
… | |
… | |
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 | // cede every 500 objects loaded |
1064 | { |
1063 | coroapi::cede_every (500); |
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 | |
1064 | |
1075 | return parse_object (op, fp, map_flags); |
1065 | return parse_object (op, fp, map_flags); |
1076 | } |
1066 | } |
1077 | |
1067 | |
1078 | /* This takes a buffer, scans it for variables, and sets those variables |
1068 | /* This takes a buffer, scans it for variables, and sets those variables |
… | |
… | |
1450 | * the only place this is not set is when saving the player. |
1440 | * the only place this is not set is when saving the player. |
1451 | */ |
1441 | */ |
1452 | void |
1442 | void |
1453 | save_object (object_freezer &fp, object *op, int flag) |
1443 | save_object (object_freezer &fp, object *op, int flag) |
1454 | { |
1444 | { |
|
|
1445 | // cede every 500 objects saved |
|
|
1446 | coroapi::cede_every (500); |
|
|
1447 | |
1455 | /* Even if the object does have an owner, it would seem that we should |
1448 | /* Even if the object does have an owner, it would seem that we should |
1456 | * still save it. |
1449 | * still save it. |
1457 | */ |
1450 | */ |
1458 | if (op->owner) |
1451 | if (op->owner) |
1459 | return; |
1452 | return; |