From 1b290a7e7e2cda467d7d40f6ecdb5570772830cc Mon Sep 17 00:00:00 2001 From: ZivDero Date: Sat, 19 Aug 2023 02:35:28 +0300 Subject: [PATCH] Fix crash when moving waypoints --- src/TSMapEditor/Models/Map.cs | 3 +++ src/TSMapEditor/Models/MapTile.cs | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/TSMapEditor/Models/Map.cs b/src/TSMapEditor/Models/Map.cs index b3ed9fa0..2051cff4 100644 --- a/src/TSMapEditor/Models/Map.cs +++ b/src/TSMapEditor/Models/Map.cs @@ -939,6 +939,9 @@ public void MoveWaypoint(Waypoint waypoint, Point2D newCoords) /// True if the object can be moved, otherwise false. public bool CanPlaceObjectAt(IMovable movable, Point2D newCoords, bool blocksSelf, bool overlapObjects) { + if (movable.WhatAmI() == RTTIType.Waypoint) + return true; + if (movable.WhatAmI() == RTTIType.Building) { bool canPlace = true; diff --git a/src/TSMapEditor/Models/MapTile.cs b/src/TSMapEditor/Models/MapTile.cs index ec9af5fc..6b0ce97c 100644 --- a/src/TSMapEditor/Models/MapTile.cs +++ b/src/TSMapEditor/Models/MapTile.cs @@ -225,8 +225,6 @@ public bool CanAddObject(GameObject gameObject, bool blocksSelf, bool overlapObj return GetFreeSubCellSpot() != SubCell.None; case RTTIType.Terrain: return TerrainObject == null; - case RTTIType.Waypoint: - return true; } return false;