(svn r16525) -Codechange: Notify small ufos on deletion of road vehicles, so they can head for somewhere else instead of stumbling over a ghost.
This commit is contained in:
@@ -1841,6 +1841,19 @@ bool AfterLoadGame()
|
||||
}
|
||||
}
|
||||
|
||||
if (CheckSavegameVersion(121)) {
|
||||
/* Delete small ufos heading for non-existing vehicles */
|
||||
Vehicle *v;
|
||||
FOR_ALL_DISASTERVEHICLES(v) {
|
||||
if (v->subtype == 2/*ST_SMALL_UFO*/ && v->current_order.GetDestination() != 0) {
|
||||
const Vehicle *u = Vehicle::GetIfValid(v->dest_tile);
|
||||
if (u == NULL || u->type != VEH_ROAD || !IsRoadVehFront(u)) {
|
||||
delete v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AfterLoadLabelMaps();
|
||||
|
||||
GamelogPrintDebug(1);
|
||||
|
Reference in New Issue
Block a user