Skip to content

Commit

Permalink
Merge pull request #38 from icydee/develop
Browse files Browse the repository at this point in the history
Add hysterisis to remove rounding errors and subsequent building damage
  • Loading branch information
icydee committed Jul 22, 2012
2 parents 8fa8f37 + 63e2a0d commit f1e6c3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Lacuna/DB/Result/Map/Body/Planet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1490,8 +1490,8 @@ sub tick_to {

}
# if we *still* have ore to consume when we have nothing then we are in trouble!
if ($ore_consumed > 0) {
# deduct an arbitrary ore-stuff
if ($ore_consumed > 20) {
# deduct an arbitrary ore-stuff, but allow for rounding (hence the '20')
$self->spend_ore_type('gold', $ore_consumed, 'complain');
}
}
Expand Down Expand Up @@ -1545,8 +1545,8 @@ sub tick_to {
}
}
# if we *still* have food to consume when we have nothing then we are in trouble!
if ($food_consumed > 0) {
# deduct an arbitrary food-stuff
if ($food_consumed > 20) {
# deduct an arbitrary food-stuff, but allow for rounding errors (hence the 20)
$self->spend_food_type('algae', $food_consumed, 'complain');
}
}
Expand Down

0 comments on commit f1e6c3b

Please sign in to comment.