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 committed Aug 17, 2023
1 parent a6e5b23 commit 6a5be5f
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 @@ -937,6 +937,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 6a5be5f

Please sign in to comment.