Skip to content

Commit

Permalink
Fix crash when moving waypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
ZivDero authored Aug 18, 2023
1 parent a762f25 commit 1b290a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/TSMapEditor/Models/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,9 @@ public void MoveWaypoint(Waypoint waypoint, Point2D newCoords)
/// <returns>True if the object can be moved, otherwise false.</returns>
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;
Expand Down
2 changes: 0 additions & 2 deletions src/TSMapEditor/Models/MapTile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1b290a7

Please sign in to comment.