--- deliantra/server/ext/jeweler.ext 2006/12/15 19:29:18 1.1 +++ deliantra/server/ext/jeweler.ext 2007/01/31 14:11:02 1.3 @@ -83,7 +83,9 @@ $chdl->put ($ring->to_object); } -cf::attach_to_type cf::SKILL, cf::SK_JEWELER, +cf::object->attach ( + type => cf::SKILL, + subtype => cf::SK_JEWELER, on_use_skill => sub { my ($sk, $ob, $part, $dir, $msg) = @_; my $pl = $ob; @@ -94,7 +96,6 @@ my $rv = 1; eval { - Jeweler::read_config ($ENV{CROSSFIRE_LIBDIR} . '/jeweler.yaml'); $DEBUG = 1; my $player = $ob->contr; @@ -153,9 +154,9 @@ my %keys; my %cdiff; for (keys %$c1, keys %$c2) { $keys{$_} = 1 } - for (keys %keys) { $cdiff{$_} = $c2->{$_} - $c1->{$_} } + for (keys %keys) { $cdiff{$_} = $c2->{$_} - $c1->{$_}; warn "$_: $c2->{$_} | $c1->{$_}\n"; } - unless (grep { $_ > 0 } values %cdiff) { + unless ($iring->is_better_than ($ringo)) { $pl->message ("This plan doesn't improve anything, you find yourself puzzled about what you missed..."); return; } @@ -186,5 +187,6 @@ }; $@ and warn "ERROR: $@\n"; } -; +); +Jeweler::read_config (cf::datadir . '/jeweler.yaml');