ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/utils/cfutil.in
(Generate patch)

Comparing deliantra/server/utils/cfutil.in (file contents):
Revision 1.7 by root, Sun Mar 11 20:37:04 2007 UTC vs.
Revision 1.10 by root, Mon Mar 12 14:47:53 2007 UTC

202 202
203 my $arc = read_arch "$dir/$file"; 203 my $arc = read_arch "$dir/$file";
204 for my $o (values %$arc) { 204 for my $o (values %$arc) {
205 push @ARC, $o; 205 push @ARC, $o;
206 206
207 $o->{editor_folder} = $dir;
208
207 my $visibility = delete $o->{visibility}; 209 my $visibility = delete $o->{visibility};
208 my $magicmap = delete $o->{magicmap}; 210 my $magicmap = delete $o->{magicmap};
209 211
210 # find upper left corner :/ 212 # find upper left corner :/
211 # omg, this is sooo broken 213 # omg, this is sooo broken
219 my $x = $o->{x} - $dx; 221 my $x = $o->{x} - $dx;
220 my $y = $o->{y} - $dy; 222 my $y = $o->{y} - $dy;
221 223
222 my $ext = $x|$y ? "+$x+$y" : ""; 224 my $ext = $x|$y ? "+$x+$y" : "";
223 225
224 $o->{face} .= $ext; 226 $o->{face} .= $ext unless /^blank.x11$|^empty.x11$/;
225 227
226 my $visibility = delete $o->{visibility} if exists $o->{visibility}; 228 my $visibility = delete $o->{visibility} if exists $o->{visibility};
227 my $magicmap = delete $o->{magicmap} if exists $o->{magicmap}; 229 my $magicmap = delete $o->{magicmap} if exists $o->{magicmap};
228 230
229 my $anim = delete $o->{anim}; 231 my $anim = delete $o->{anim};
230 232
231 if ($anim) { 233 if ($anim) {
232 $o->{animation} = "$o->{_name}$ext"; 234 $o->{animation} = "$o->{_name}";
233 235
234 for (@$anim) { 236 for (@$anim) {
235 $_ .= $ext unless /^facings\s/; 237 $_ .= $ext unless /^facings\s|^blank.x11$|^empty.x11$/;
236 } 238 }
237 239
238 $ANIM{"$o->{_name}$ext"} = 240 $ANIM{"$o->{_name}$ext"} =
239 join "", map "$_\n", 241 join "", map "$_\n",
240 "anim $o->{_name}$ext", 242 "anim $o->{_name}",
241 @$anim, 243 @$anim,
242 "mina"; 244 "mina";
243 } 245 }
244 246
245 for my $face ($o->{face} || (), @{$anim || []}) { 247 for my $face ($o->{face} || (), @{$anim || []}) {
246 next if /^facings\s/; 248 next if $face =~ /^facings\s|^blank.x11$|^empty.x11$/;
247 249
248 my $info = $FACEINFO{$face} ||= {}; 250 my $info = $FACEINFO{$face} ||= {};
249 251
250 $info->{visibility} = $visibility if defined $visibility; 252 $info->{visibility} = $visibility if defined $visibility;
251 $info->{magicmap} = $magicmap if defined $magicmap; 253 $info->{magicmap} = $magicmap if defined $magicmap;
312 } 314 }
313 315
314 { 316 {
315 open my $fh, ">:utf8", "$DATADIR/archetypes~" 317 open my $fh, ">:utf8", "$DATADIR/archetypes~"
316 or die "$DATADIR/archetypes~: $!"; 318 or die "$DATADIR/archetypes~: $!";
319 substr $_->{editor_folder}, 0, length $path, "" for @ARC;
317 print $fh Crossfire::archlist_to_string \@ARC; 320 print $fh Crossfire::archlist_to_string \@ARC;
318 } 321 }
319 322
320 { 323 {
321 while (my ($k, $v) = each %FACEINFO) { 324 while (my ($k, $v) = each %FACEINFO) {
322 $v->{data32} ||= delete $PNG32{$k}; 325 $v->{data32} ||= delete $PNG32{$k};
323 } 326 }
324 327
325 while (my ($k, $v) = each %FACEINFO) { 328 while (my ($k, $v) = each %FACEINFO) {
326 exists $v->{data32} or warn "$k: face has no png32. this will crash the server.\n"; 329 length $v->{data32} or warn "$k: face has no png32. this will crash the server.\n";
327 330
328 $v->{chksum32} = Digest::MD5::md5 $v->{data32}; 331 $v->{chksum32} = Digest::MD5::md5 $v->{data32};
329 } 332 }
330 333
331 open my $fh, ">:perlio", "$DATADIR/faces~" 334 open my $fh, ">:perlio", "$DATADIR/faces~"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines