diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet.pm b/lib/Lacuna/DB/Result/Map/Body/Planet.pm index 8dfe716a..cf6f2a24 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Planet.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Planet.pm @@ -258,23 +258,6 @@ sub sanitize { my ($self) = @_; my @buildings = grep {$_->class !~ /Permanent/} @{$self->building_cache}; $self->delete_buildings(\@buildings); - my @attributes = qw( happiness_hour happiness waste_hour waste_stored waste_capacity - energy_hour energy_stored energy_capacity water_hour water_stored water_capacity ore_capacity - rutile_stored chromite_stored chalcopyrite_stored galena_stored gold_stored uraninite_stored bauxite_stored - goethite_stored halite_stored gypsum_stored trona_stored kerogen_stored methane_stored anthracite_stored - sulfur_stored zircon_stored monazite_stored fluorite_stored beryl_stored magnetite_stored - food_capacity food_consumption_hour lapis_production_hour potato_production_hour apple_production_hour - root_production_hour corn_production_hour cider_production_hour wheat_production_hour bread_production_hour - soup_production_hour chip_production_hour pie_production_hour pancake_production_hour milk_production_hour - meal_production_hour algae_production_hour syrup_production_hour fungus_production_hour burger_production_hour - shake_production_hour beetle_production_hour lapis_stored potato_stored apple_stored root_stored corn_stored - cider_stored wheat_stored bread_stored soup_stored chip_stored pie_stored pancake_stored milk_stored meal_stored - algae_stored syrup_stored fungus_stored burger_stored shake_stored beetle_stored bean_production_hour bean_stored - restrict_coverage cheese_production_hour cheese_stored - ); - foreach my $attribute (@attributes) { - $self->$attribute(0); - } $self->alliance_id(undef); $self->_plans->delete; $self->glyph->delete; @@ -311,6 +294,23 @@ sub sanitize { $self->zone ~~ ['1|1','1|-1','-1|1','-1|-1','0|0','0|1','1|0','-1|0','0|-1']) { $self->usable_as_starter_enabled(1); } + my @attributes = qw( happiness_hour happiness waste_hour waste_stored waste_capacity + energy_hour energy_stored energy_capacity water_hour water_stored water_capacity ore_capacity + rutile_stored chromite_stored chalcopyrite_stored galena_stored gold_stored uraninite_stored bauxite_stored + goethite_stored halite_stored gypsum_stored trona_stored kerogen_stored methane_stored anthracite_stored + sulfur_stored zircon_stored monazite_stored fluorite_stored beryl_stored magnetite_stored + food_capacity food_consumption_hour lapis_production_hour potato_production_hour apple_production_hour + root_production_hour corn_production_hour cider_production_hour wheat_production_hour bread_production_hour + soup_production_hour chip_production_hour pie_production_hour pancake_production_hour milk_production_hour + meal_production_hour algae_production_hour syrup_production_hour fungus_production_hour burger_production_hour + shake_production_hour beetle_production_hour lapis_stored potato_stored apple_stored root_stored corn_stored + cider_stored wheat_stored bread_stored soup_stored chip_stored pie_stored pancake_stored milk_stored meal_stored + algae_stored syrup_stored fungus_stored burger_stored shake_stored beetle_stored bean_production_hour bean_stored + restrict_coverage cheese_production_hour cheese_stored + ); + foreach my $attribute (@attributes) { + $self->$attribute(0); + } $self->update; return $self; } @@ -1129,6 +1129,24 @@ sub found_colony { } } + # Initialize body + my @attributes = qw( happiness_hour happiness waste_hour waste_stored waste_capacity + energy_hour energy_stored energy_capacity water_hour water_stored water_capacity ore_capacity + rutile_stored chromite_stored chalcopyrite_stored galena_stored gold_stored uraninite_stored bauxite_stored + goethite_stored halite_stored gypsum_stored trona_stored kerogen_stored methane_stored anthracite_stored + sulfur_stored zircon_stored monazite_stored fluorite_stored beryl_stored magnetite_stored + food_capacity food_consumption_hour lapis_production_hour potato_production_hour apple_production_hour + root_production_hour corn_production_hour cider_production_hour wheat_production_hour bread_production_hour + soup_production_hour chip_production_hour pie_production_hour pancake_production_hour milk_production_hour + meal_production_hour algae_production_hour syrup_production_hour fungus_production_hour burger_production_hour + shake_production_hour beetle_production_hour lapis_stored potato_stored apple_stored root_stored corn_stored + cider_stored wheat_stored bread_stored soup_stored chip_stored pie_stored pancake_stored milk_stored meal_stored + algae_stored syrup_stored fungus_stored burger_stored shake_stored beetle_stored bean_production_hour bean_stored + restrict_coverage cheese_production_hour cheese_stored + ); + foreach my $attribute (@attributes) { + $self->$attribute(0); + } # add starting resources $self->needs_recalc(1); $self->tick; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 00a31be3..bf8ab7c6 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -7,6 +7,7 @@ - Add: Constructing added to resource bar. - UI : Stop the "Trade Ministry is offline" message when repairing TM - UI : Added self-destruct button back. + - Fix: Modify sanitize to do initialize of stored values last. 3.0912: - Fix: get_fleet_for returns berth appropriate ships.