Fix the names including apostrophes

This commit is contained in:
Marc Di Luzio 2020-06-08 23:37:03 +01:00
parent 43588c0e4b
commit 066df58705

View file

@ -3,6 +3,7 @@ package game
import ( import (
"fmt" "fmt"
"math/rand" "math/rand"
"strings"
"sync" "sync"
"github.com/google/uuid" "github.com/google/uuid"
@ -58,11 +59,13 @@ func (w *World) SpawnRover() (uuid.UUID, error) {
Range: 5.0, Range: 5.0,
// Set the name randomly // Set the name randomly
// TODO: Fix the stupid "'s"
Name: babble.NewBabbler().Babble(), Name: babble.NewBabbler().Babble(),
}, },
} }
// Dictionaries tend to include the possesive
strings.ReplaceAll(rover.Attributes.Name, "'s", "")
// Spawn in a random place near the origin // Spawn in a random place near the origin
rover.Attributes.Pos = Vector{ rover.Attributes.Pos = Vector{
w.Atlas.ChunkSize - (rand.Int() % (w.Atlas.ChunkSize * 2)), w.Atlas.ChunkSize - (rand.Int() % (w.Atlas.ChunkSize * 2)),