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
 
@@ -1762,24 +1762,29 @@ bool AfterLoadGame()
 
		for (Vehicle *v : Vehicle::Iterate()) {
 
			if ((v->current_order.GetUnloadType() & (OUFB_UNLOAD | OUFB_TRANSFER)) == (OUFB_UNLOAD | OUFB_TRANSFER)) {
 
				v->current_order.SetUnloadType(OUFB_TRANSFER);
 
				v->current_order.SetLoadType(OLFB_NO_LOAD);
 
			}
 
		}
 
	} 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)) {
 
				case MP_STATION:
 
					switch (GetStationType(t)) {
 
						case STATION_OILRIG:
 
						case STATION_DOCK:
 
						case STATION_BUOY:
 
							SetWaterClass(t, (WaterClass)GB(t.m3(), 0, 2));
0 comments (0 inline, 0 general)