--- deliantra/server/common/map.C 2007/01/01 12:28:45 1.64 +++ deliantra/server/common/map.C 2007/01/03 00:21:35 1.66 @@ -489,6 +489,8 @@ bool maptile::save_objects (object_freezer &freezer, int flags) { + static int cede_count = 0; + if (flags & IO_HEADER) save_header (freezer); @@ -497,9 +499,18 @@ for (int i = 0; i < size (); ++i) { + if (cede_count >= 500) + { + cede_count = 0; + coroapi::cede (); + } + int unique = 0; for (object *op = spaces [i].bot; op; op = op->above) { + // count per-object, but cede only when modification-safe + cede_count++; + if (op->flag [FLAG_UNIQUE] && op->flag [FLAG_IS_FLOOR]) unique = 1; @@ -1374,7 +1385,7 @@ * instead we return NULL if no map is valid (coordinates * out of bounds and no tiled map), otherwise it returns * the map as that the coordinates are really on, and - * updates x and y to be the localized coordinates. + * updates x and y to be the localised coordinates. * Using this is more efficient of calling out_of_map * and then figuring out what the real map is */