Can't plant flower over existing flower.
This commit is contained in:
parent
9f19e4bd92
commit
905aad2afa
5
game.go
5
game.go
@ -163,6 +163,11 @@ func (g *Game) Load() {
|
||||
func (g *Game) Pause() { g.setSpeed(GameSpeedPaused) }
|
||||
|
||||
func (g *Game) PlantFlower(id string, tile Point) {
|
||||
if g.Terrain.HasFlower(tile) {
|
||||
// TODO: notify user it tried to plant on tile with flower?
|
||||
return
|
||||
}
|
||||
|
||||
flower, ok := g.Herbarium.Find(id)
|
||||
if !ok {
|
||||
log.Println("user was able to plant a flower that doesn't exist")
|
||||
|
Loading…
Reference in New Issue
Block a user