ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.121 by root, Tue Jan 2 11:11:52 2007 UTC vs.
Revision 1.126 by root, Tue Jan 2 23:12:47 2007 UTC

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++...
1155sub change_all_map_light { 1155sub 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
1161sub try_load_header($) { 1162sub try_load_header($) {
1162 my ($path) = @_; 1163 my ($path) = @_;
1163 1164
1174 $map->{load_path} = $path; 1175 $map->{load_path} = $path;
1175 1176
1176 $map 1177 $map
1177} 1178}
1178 1179
1180sub find_map;
1179sub find_map { 1181sub find_map {
1180 my ($path, $origin) = @_; 1182 my ($path, $origin) = @_;
1181 1183
1182 #warn "find_map<$path,$origin>\n";#d# 1184 #warn "find_map<$path,$origin>\n";#d#
1183 1185
1218 $map->{last_save} = $cf::RUNTIME; 1220 $map->{last_save} = $cf::RUNTIME;
1219 $map->last_access ($cf::RUNTIME); 1221 $map->last_access ($cf::RUNTIME);
1220 1222
1221 if ($map->should_reset) { 1223 if ($map->should_reset) {
1222 $map->reset; 1224 $map->reset;
1225 undef $guard;
1223 $map = find_map $path; 1226 $map = find_map $path
1227 or return;
1224 } 1228 }
1225 1229
1226 $cf::MAP{$key} = $map 1230 $cf::MAP{$key} = $map
1227 } 1231 }
1228} 1232}
2188 or warn "ERROR: unable to write runtime file: $!"; 2192 or warn "ERROR: unable to write runtime file: $!";
2189 })->(); 2193 })->();
2190 }, 2194 },
2191); 2195);
2192 2196
2197END { cf::emergency_save }
2198
21931 21991
2194 2200

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines