From 5bfead4755c46f543c7eadf3388b15b18885363a Mon Sep 17 00:00:00 2001 From: JT Smith Date: Mon, 27 Sep 2010 15:55:51 -0500 Subject: [PATCH] fixed mm calc bug --- lib/Lacuna/DB/Result/Map/Body/Planet.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet.pm b/lib/Lacuna/DB/Result/Map/Body/Planet.pm index 447fa4d7..dac29f62 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Planet.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Planet.pm @@ -587,6 +587,7 @@ sub recalc_stats { my ($self) = @_; my %stats = ( needs_recalc => 0 ); my $buildings = $self->buildings; + my $mining_ministry_ore_hour = 0; while (my $building = $buildings->next) { $stats{waste_capacity} += $building->waste_capacity; $stats{water_capacity} += $building->water_capacity; @@ -609,7 +610,7 @@ sub recalc_stats { foreach my $type (ORE_TYPES) { my $method = $type.'_hour'; $stats{$method} += $platform->$method(); - $stats{ore_hour} += $platform->$method(); + $mining_ministry_ore_hour += $platform->$method(); } } } @@ -618,6 +619,7 @@ sub recalc_stats { my $method = $type.'_hour'; $stats{$method} += sprintf('%.0f',$self->$type * $stats{ore_hour} / 10000); } + $stats{ore_hour} += $mining_ministry_ore_hour; $self->update(\%stats); return $self; } -- 2.54.0