Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash caused by moving waypoints #57

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading