map now respects 0% food spawn chance (#110)

This commit is contained in:
Chris Hoefgen 2022-09-06 15:20:07 -07:00 committed by GitHub
parent 09aea9c49d
commit c5810d8604
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,7 +75,7 @@ func (m ArcadeMazeMap) UpdateBoard(lastBoardState *rules.BoardState, settings ru
rand := settings.GetRand(lastBoardState.Turn)
// Respect FoodSpawnChance setting
if rand.Intn(100) > settings.FoodSpawnChance {
if settings.FoodSpawnChance == 0 || rand.Intn(100) > settings.FoodSpawnChance {
return nil
}