(svn r22057) -Fix: waypoint conversion could (previously) silently overfill the pool and crash

This commit is contained in:
rubidium
2011-02-11 09:33:38 +00:00
parent 246f6fe478
commit 13fd2cd335
2 changed files with 5 additions and 0 deletions

View File

@@ -93,6 +93,8 @@ void MoveWaypointsToBaseStations()
}
}
if (!Waypoint::CanAllocateItem(_old_waypoints.Length())) SlError(STR_ERROR_TOO_MANY_STATIONS_LOADING);
/* All saveload conversions have been done. Create the new waypoints! */
for (OldWaypoint *wp = _old_waypoints.Begin(); wp != _old_waypoints.End(); wp++) {
Waypoint *new_wp = new Waypoint(wp->xy);