Changeset - r28828:76c6b8ce3c7c
[Not reviewed]
master
0 1 0
Loïc Guilloux - 9 months ago 2024-02-27 20:25:49
glx22@users.noreply.github.com
Fix f6dd505: Missing savegame conversion for current_order (#12188)
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/saveload/afterload.cpp
Show inline comments
 
@@ -1768,12 +1768,17 @@ bool AfterLoadGame()
 
	} else if (IsSavegameVersionBefore(SLV_DEPOT_UNBUNCHING)) {
 
		/* OrderDepotActionFlags were moved, instead of starting at bit 4 they now start at bit 3. */
 
		for (Order *order : Order::Iterate()) {
 
			if (!order->IsType(OT_GOTO_DEPOT)) continue;
 
			order->SetDepotActionType((OrderDepotActionFlags)(order->GetDepotActionType() >> 1));
 
		}
 

	
 
		for (Vehicle *v : Vehicle::Iterate()) {
 
			if (!v->current_order.IsType(OT_GOTO_DEPOT)) continue;
 
			v->current_order.SetDepotActionType((OrderDepotActionFlags)(v->current_order.GetDepotActionType() >> 1));
 
		}
 
	}
 

	
 
	/* The water class was moved/unified. */
 
	if (IsSavegameVersionBefore(SLV_146)) {
 
		for (auto t : Map::Iterate()) {
 
			switch (GetTileType(t)) {
0 comments (0 inline, 0 general)