From 325bea157b95ac3e11faf3e4c1a8092b31422f90 Mon Sep 17 00:00:00 2001 From: oleg20111511 Date: Fri, 16 Jun 2023 19:18:12 +0300 Subject: [PATCH] Fix player placemnt bug --- Assets/Scripts/Level/LayoutCell.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/Scripts/Level/LayoutCell.cs b/Assets/Scripts/Level/LayoutCell.cs index c145749..301584e 100644 --- a/Assets/Scripts/Level/LayoutCell.cs +++ b/Assets/Scripts/Level/LayoutCell.cs @@ -77,6 +77,12 @@ namespace Level public void ChangeEnv(LevelBuilderButtons.PlacementOption placementOption) { + // Can't place on the same block as player + if (cellData.cellContent == LayoutCellData.CellContent.Player) + { + return; + } + // Clean previous contents cellData.cellContent = LayoutCellData.CellContent.None; cellData.isTarget = false;