Codechange: Use a dedicated variable for disaster vehicle action state. (#10798)

This commit is contained in:
Michael Lutz
2023-05-12 21:41:36 +02:00
committed by GitHub
parent 1a93618bd1
commit 72c7536325
6 changed files with 44 additions and 37 deletions

View File

@@ -2141,8 +2141,8 @@ bool AfterLoadGame()
if (IsSavegameVersionBefore(SLV_121)) {
/* Delete small ufos heading for non-existing vehicles */
for (Vehicle *v : DisasterVehicle::Iterate()) {
if (v->subtype == 2 /* ST_SMALL_UFO */ && v->current_order.GetDestination() != 0) {
for (DisasterVehicle *v : DisasterVehicle::Iterate()) {
if (v->subtype == 2 /* ST_SMALL_UFO */ && v->state != 0) {
const Vehicle *u = Vehicle::GetIfValid(v->dest_tile);
if (u == nullptr || u->type != VEH_ROAD || !RoadVehicle::From(u)->IsFrontEngine()) {
delete v;