Fix tile hash cache check warnings when loading very old savegames

See: #648
pull/653/head
Jonathan G Rennison 3 months ago
parent 11f75933bf
commit 3407b3edc0

@ -1005,12 +1005,12 @@ static bool AircraftController(Aircraft *v)
int z = GetSlopePixelZ(x, y) + 1 + afc->delta_z;
if (z == v->z_pos) {
v->UpdatePosition();
Vehicle *u = v->Next()->Next();
/* Increase speed of rotors. When speed is 80, we've landed. */
if (u->cur_speed >= 80) {
ClrBit(v->flags, VAF_HELI_DIRECT_DESCENT);
v->UpdatePosition();
return true;
}
u->cur_speed += 4;

@ -1218,6 +1218,9 @@ bool AfterLoadGame()
/* Force the freeform edges to false for old savegames. */
if (IsSavegameVersionBefore(SLV_111)) {
_settings_game.construction.freeform_edges = false;
for (Vehicle *v : Vehicle::Iterate()) {
if (v->tile == 0) v->UpdatePosition();
}
}
/* From version 9.0, we update the max passengers of a town (was sometimes negative
@ -2960,10 +2963,12 @@ bool AfterLoadGame()
if (dir == vdir) { // Entering tunnel
hidden = frame >= _tunnel_visibility_frame[dir];
v->tile = vtile;
v->UpdatePosition();
} else if (dir == ReverseDiagDir(vdir)) { // Leaving tunnel
hidden = frame < TILE_SIZE - _tunnel_visibility_frame[dir];
/* v->tile changes at the moment when the vehicle leaves the tunnel. */
v->tile = hidden ? GetOtherTunnelBridgeEndOld(vtile) : vtile;
v->UpdatePosition();
} else {
/* We could get here in two cases:
* - for road vehicles, it is reversing at the end of the tunnel

@ -1678,6 +1678,9 @@ static void UpdateFreeformEdges(int32_t new_value)
MakeSea(TileXY(0, i));
}
}
for (Vehicle *v : Vehicle::Iterate()) {
if (v->tile == 0) v->UpdatePosition();
}
MarkWholeScreenDirty();
}

Loading…
Cancel
Save