Rename "EliminatedByStarvation" > "EliminatedByOutOfHealth"

This commit is contained in:
Brad Van Vugt 2020-09-10 12:00:56 -07:00
parent 92592c2aba
commit f5aec61e04
5 changed files with 27 additions and 25 deletions

View file

@ -108,9 +108,11 @@ func (r *RoyaleRuleset) damageOutOfBounds(b *BoardState) error {
if head == p {
// Snake is now out of bounds, reduce health
snake.Health = snake.Health - r.DamagePerTurn
if snake.Health <= 0 {
if snake.Health < 0 {
snake.Health = 0
snake.EliminatedCause = EliminatedByStarvation
}
if r.StandardRuleset.snakeIsOutOfHealth(snake) {
snake.EliminatedCause = EliminatedByOutOfHealth
}
}
}