From fe7fdb785859485676b18c293906e950e2e6003a Mon Sep 17 00:00:00 2001 From: Anton Vakhrushev Date: Tue, 15 Oct 2019 16:38:15 +0300 Subject: [PATCH] Add building check --- src/game/command.cr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game/command.cr b/src/game/command.cr index 645fce2..db6f3b0 100644 --- a/src/game/command.cr +++ b/src/game/command.cr @@ -20,6 +20,10 @@ module Game if !world.resources.has(construction.cost) raise NotEnoughtResources.new end + tile = world.map.get @point + if !tile.as?(PlateauTile) + raise InvalidPlaceForBuilding.new + end # @todo check requirements world.map.set(ConstructionSiteTile.new(@point)) construction.ts