… | |
… | |
1153 | # and all this just because we cannot iterate over |
1153 | # and all this just because we cannot iterate over |
1154 | # all maps in C++... |
1154 | # all maps in C++... |
1155 | sub change_all_map_light { |
1155 | sub change_all_map_light { |
1156 | my ($change) = @_; |
1156 | my ($change) = @_; |
1157 | |
1157 | |
1158 | $_->change_map_light ($change) for values %cf::MAP; |
1158 | $_->change_map_light ($change) |
|
|
1159 | for grep $_->outdoor, values %cf::MAP; |
1159 | } |
1160 | } |
1160 | |
1161 | |
1161 | sub try_load_header($) { |
1162 | sub try_load_header($) { |
1162 | my ($path) = @_; |
1163 | my ($path) = @_; |
1163 | |
1164 | |
… | |
… | |
1218 | $map->{last_save} = $cf::RUNTIME; |
1219 | $map->{last_save} = $cf::RUNTIME; |
1219 | $map->last_access ($cf::RUNTIME); |
1220 | $map->last_access ($cf::RUNTIME); |
1220 | |
1221 | |
1221 | if ($map->should_reset) { |
1222 | if ($map->should_reset) { |
1222 | $map->reset; |
1223 | $map->reset; |
|
|
1224 | undef $guard; |
1223 | $map = find_map $path; |
1225 | $map = cf::map::find_map ($path) |
|
|
1226 | or return; |
1224 | } |
1227 | } |
1225 | |
1228 | |
1226 | $cf::MAP{$key} = $map |
1229 | $cf::MAP{$key} = $map |
1227 | } |
1230 | } |
1228 | } |
1231 | } |
… | |
… | |
2188 | or warn "ERROR: unable to write runtime file: $!"; |
2191 | or warn "ERROR: unable to write runtime file: $!"; |
2189 | })->(); |
2192 | })->(); |
2190 | }, |
2193 | }, |
2191 | ); |
2194 | ); |
2192 | |
2195 | |
|
|
2196 | END { cf::emergency_save } |
|
|
2197 | |
2193 | 1 |
2198 | 1 |
2194 | |
2199 | |