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

(cherry picked from commit 72c7536325)
This commit is contained in:
Michael Lutz
2023-05-12 20:41:36 +01:00
committed by Jonathan G Rennison
parent 2c91866831
commit e5654a0414
9 changed files with 50 additions and 39 deletions

View File

@@ -2549,8 +2549,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;