From de0ccbaa6e09d03ac3a3f3dd43a84e262f52e766 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sun, 7 Jun 2020 23:05:36 +0100 Subject: [PATCH] Fix the random rock spawns --- pkg/game/atlas.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/game/atlas.go b/pkg/game/atlas.go index d5d9a5a..ac0b9c5 100644 --- a/pkg/game/atlas.go +++ b/pkg/game/atlas.go @@ -54,7 +54,7 @@ func (a *Atlas) SpawnWorld() error { // Pepper the current world with rocks for i := -extent; i < extent; i++ { for j := -extent; j < extent; j++ { - if rand.Int()%16 == 0 { + if rand.Intn(16) == 0 { if err := a.SetTile(Vector{i, j}, TileRock); err != nil { return err }