… | |
… | |
398 | bool |
398 | bool |
399 | maptile::_load_objects (object_thawer &f) |
399 | maptile::_load_objects (object_thawer &f) |
400 | { |
400 | { |
401 | for (;;) |
401 | for (;;) |
402 | { |
402 | { |
403 | coroapi::cede_every (1000); // cede once in a while |
403 | coroapi::cede_to_tick_every (100); // cede once in a while |
404 | |
404 | |
405 | switch (f.kw) |
405 | switch (f.kw) |
406 | { |
406 | { |
407 | case KW_arch: |
407 | case KW_arch: |
408 | if (object *op = object::read (f, this)) |
408 | if (object *op = object::read (f, this)) |
… | |
… | |
453 | } |
453 | } |
454 | |
454 | |
455 | bool |
455 | bool |
456 | maptile::_save_objects (object_freezer &f, int flags) |
456 | maptile::_save_objects (object_freezer &f, int flags) |
457 | { |
457 | { |
458 | coroapi::cede (); |
458 | coroapi::cede_to_tick (); |
459 | |
459 | |
460 | if (flags & IO_HEADER) |
460 | if (flags & IO_HEADER) |
461 | _save_header (f); |
461 | _save_header (f); |
462 | |
462 | |
463 | if (!spaces) |
463 | if (!spaces) |
… | |
… | |
482 | else if (flags & IO_OBJECTS) |
482 | else if (flags & IO_OBJECTS) |
483 | op->write (f); |
483 | op->write (f); |
484 | } |
484 | } |
485 | } |
485 | } |
486 | |
486 | |
487 | coroapi::cede (); |
487 | coroapi::cede_to_tick (); |
488 | |
488 | |
489 | return true; |
489 | return true; |
490 | } |
490 | } |
491 | |
491 | |
492 | bool |
492 | bool |