… | |
… | |
1203 | |
1203 | |
1204 | # do it the slow way |
1204 | # do it the slow way |
1205 | my $map = try_load_header $path->save_path; |
1205 | my $map = try_load_header $path->save_path; |
1206 | |
1206 | |
1207 | if ($map) { |
1207 | if ($map) { |
|
|
1208 | $map->last_access ((delete $map->{last_access}) |
|
|
1209 | || $cf::RUNTIME); #d# |
1208 | # safety |
1210 | # safety |
1209 | $map->{instantiate_time} = $cf::RUNTIME |
1211 | $map->{instantiate_time} = $cf::RUNTIME |
1210 | if $map->{instantiate_time} > $cf::RUNTIME; |
1212 | if $map->{instantiate_time} > $cf::RUNTIME; |
1211 | } else { |
1213 | } else { |
1212 | if (my $rmp = $path->random_map_params) { |
1214 | if (my $rmp = $path->random_map_params) { |
… | |
… | |
1217 | |
1219 | |
1218 | $map or return; |
1220 | $map or return; |
1219 | |
1221 | |
1220 | $map->{load_original} = 1; |
1222 | $map->{load_original} = 1; |
1221 | $map->{instantiate_time} = $cf::RUNTIME; |
1223 | $map->{instantiate_time} = $cf::RUNTIME; |
|
|
1224 | $map->last_access ($cf::RUNTIME); |
1222 | $map->instantiate; |
1225 | $map->instantiate; |
1223 | |
1226 | |
1224 | # per-player maps become, after loading, normal maps |
1227 | # per-player maps become, after loading, normal maps |
1225 | $map->per_player (0) if $path->{user_rel}; |
1228 | $map->per_player (0) if $path->{user_rel}; |
1226 | } |
1229 | } |
1227 | |
1230 | |
1228 | $map->path ($key); |
1231 | $map->path ($key); |
1229 | $map->{path} = $path; |
1232 | $map->{path} = $path; |
1230 | $map->{last_save} = $cf::RUNTIME; |
1233 | $map->{last_save} = $cf::RUNTIME; |
1231 | $map->last_access ($cf::RUNTIME); |
|
|
1232 | |
1234 | |
1233 | if ($map->should_reset) { |
1235 | if ($map->should_reset) { |
1234 | $map->reset; |
1236 | $map->reset; |
1235 | undef $guard; |
1237 | undef $guard; |
1236 | $map = find_map $path |
1238 | $map = find_map $path |
… | |
… | |
1310 | |
1312 | |
1311 | $self->{load_path} = $save; |
1313 | $self->{load_path} = $save; |
1312 | |
1314 | |
1313 | return if $self->{deny_save}; |
1315 | return if $self->{deny_save}; |
1314 | |
1316 | |
|
|
1317 | local $self->{last_access} = $self->last_access;#d# |
|
|
1318 | |
1315 | if ($uniq) { |
1319 | if ($uniq) { |
1316 | $self->save_objects ($save, cf::IO_HEADER | cf::IO_OBJECTS); |
1320 | $self->save_objects ($save, cf::IO_HEADER | cf::IO_OBJECTS); |
1317 | $self->save_objects ($uniq, cf::IO_UNIQUES); |
1321 | $self->save_objects ($uniq, cf::IO_UNIQUES); |
1318 | } else { |
1322 | } else { |
1319 | $self->save_objects ($save, cf::IO_HEADER | cf::IO_OBJECTS | cf::IO_UNIQUES); |
1323 | $self->save_objects ($save, cf::IO_HEADER | cf::IO_OBJECTS | cf::IO_UNIQUES); |