From 2929ba52509964a81908fc50ae5cdbc099e8bda0 Mon Sep 17 00:00:00 2001 From: ian docherty Date: Mon, 3 Oct 2011 12:27:25 -0400 Subject: [PATCH] Bug #8 high negative happiness, high build time causes crash --- lib/Lacuna/DB/Result/Building.pm | 2 ++ var/www/public/changes.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/Lacuna/DB/Result/Building.pm b/lib/Lacuna/DB/Result/Building.pm index 41f9dc7b..53e46564 100644 --- a/lib/Lacuna/DB/Result/Building.pm +++ b/lib/Lacuna/DB/Result/Building.pm @@ -745,6 +745,8 @@ sub cost_to_upgrade { my $throttle = Lacuna->config->get('building_build_speed') || 6; my $time_cost = (($self->level+1)/$throttle * $self->time_to_build * $time_inflator ** INFLATION) * $self->time_cost_reduction_bonus * $oversight_reduction; $time_cost = 15 if ($time_cost < 15); + $time_cost = 10000000 if ($time_cost > 10000000); + return { food => sprintf('%.0f',$self->food_to_build * $upgrade_cost * $upgrade_cost_reduction), energy => sprintf('%.0f',$self->energy_to_build * $upgrade_cost * $upgrade_cost_reduction), diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index b4938613..c12fad05 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -2,6 +2,8 @@ - Fix: Alliance Stats now shows number of space stations and influence - Fix: Updated documentation for Shipyard - Fix: API - Added surface version number for bodies to better indicate that a refresh is needed + - Fix: It is no longer possible to downgrade a spaceport if it could no longer support the number of ships. + - Fix: Very high negative happiness, and very long building times should not now crash the planet 3.0813 - Add: When one 20 Stars tournament ends, the next one should begin automatically. -- 2.54.0