mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-05 13:57:01 +00:00
(svn r14265) -Fix (r10750): desyncs after deleting a waypoint because of explicit destructor call instead of using operator delete
This commit is contained in:
parent
12dcb3adb4
commit
2c0a95ed66
@ -293,7 +293,7 @@ void WaypointsDailyLoop()
|
|||||||
|
|
||||||
/* Check if we need to delete a waypoint */
|
/* Check if we need to delete a waypoint */
|
||||||
FOR_ALL_WAYPOINTS(wp) {
|
FOR_ALL_WAYPOINTS(wp) {
|
||||||
if (wp->deleted != 0 && --wp->deleted == 0) DeleteWaypoint(wp);
|
if (wp->deleted != 0 && --wp->deleted == 0) delete wp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,11 +44,6 @@ static inline bool IsValidWaypointID(WaypointID index)
|
|||||||
return index < GetWaypointPoolSize() && GetWaypoint(index)->IsValid();
|
return index < GetWaypointPoolSize() && GetWaypoint(index)->IsValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void DeleteWaypoint(Waypoint *wp)
|
|
||||||
{
|
|
||||||
wp->~Waypoint();
|
|
||||||
}
|
|
||||||
|
|
||||||
#define FOR_ALL_WAYPOINTS_FROM(wp, start) for (wp = GetWaypoint(start); wp != NULL; wp = (wp->index + 1U < GetWaypointPoolSize()) ? GetWaypoint(wp->index + 1U) : NULL) if (wp->IsValid())
|
#define FOR_ALL_WAYPOINTS_FROM(wp, start) for (wp = GetWaypoint(start); wp != NULL; wp = (wp->index + 1U < GetWaypointPoolSize()) ? GetWaypoint(wp->index + 1U) : NULL) if (wp->IsValid())
|
||||||
#define FOR_ALL_WAYPOINTS(wp) FOR_ALL_WAYPOINTS_FROM(wp, 0)
|
#define FOR_ALL_WAYPOINTS(wp) FOR_ALL_WAYPOINTS_FROM(wp, 0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user