… | |
… | |
152 | my $c2 = $iring->calc_costs; |
152 | my $c2 = $iring->calc_costs; |
153 | |
153 | |
154 | my %keys; |
154 | my %keys; |
155 | my %cdiff; |
155 | my %cdiff; |
156 | for (keys %$c1, keys %$c2) { $keys{$_} = 1 } |
156 | for (keys %$c1, keys %$c2) { $keys{$_} = 1 } |
157 | for (keys %keys) { $cdiff{$_} = $c2->{$_} - $c1->{$_} } |
157 | for (keys %keys) { $cdiff{$_} = $c2->{$_} - $c1->{$_}; warn "$_: $c2->{$_} | $c1->{$_}\n"; } |
158 | |
158 | |
159 | unless (grep { $_ > 0 } values %cdiff) { |
159 | unless ($iring->is_better_than ($ringo)) { |
160 | $pl->message ("This plan doesn't improve anything, you find yourself puzzled about what you missed..."); |
160 | $pl->message ("This plan doesn't improve anything, you find yourself puzzled about what you missed..."); |
161 | return; |
161 | return; |
162 | } |
162 | } |
163 | |
163 | |
164 | my $remcosts = $ingred->check_costs (\%cdiff); |
164 | my $remcosts = $ingred->check_costs (\%cdiff); |