--- deliantra/server/utils/cfutil.in 2007/03/07 18:04:44 1.3 +++ deliantra/server/utils/cfutil.in 2007/03/07 20:30:18 1.4 @@ -193,7 +193,24 @@ my $arc; aio_load "$dir/$file", $arc; # simply pre-cache, as read_arch wants a file :/ + my $arc = read_arch "$dir/$file"; + for my $o (values %$arc) { + push @ARC, $o; + my ($dx, $dy); + # omg, this is sooo broken + for (my $o = $o; $o; $o = $o->{more}) { + $dx = $o->{x} if $o->{x} < $dx; + $dy = $o->{y} if $o->{y} < $dy; + } + for (my $o = $o; $o; $o = $o->{more}) { + my $x = $o->{x} - $dx; + my $y = $o->{y} - $dy; + if ($x|$y) { + $_ .= "+$x+$y" for $o->{face}, @{$o->{anim} || []}; + } + } + } } } @@ -247,7 +264,13 @@ (async \&process_arc), (async \&process_arc), ); - die "--install-arch not yet implemented\n"; + open my $archetypes, ">:utf8", "$DATADIR/archetypes~" + or die "$DATADIR/archetypes~: $!"; + print $archetypes Crossfire::archlist_to_string \@ARC; + close $archetypes; + rename "$DATADIR/archetypes~", "$DATADIR/archetypes"; + + die "--install-arch not fully implemented\n"; } }