1
0
Fork 0

Fix: Aircraft crash counter was too low to reach ground.

Aircraft can float above the ground when crashed as the counter limit to reach the ground is too low.

Instead reset the counter until the aircraft reaches the ground, then continue the timer.
pull/12425/head
Peter Nelson 2024-04-04 23:56:12 +01:00
parent 7572cfd103
commit 27193cdba2
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 4 additions and 2 deletions

View File

@ -1182,9 +1182,11 @@ static bool HandleCrashedAircraft(Aircraft *v)
if (v->crashed_counter < 500 && st == nullptr && ((v->crashed_counter % 3) == 0) ) {
int z = GetSlopePixelZ(Clamp(v->x_pos, 0, Map::MaxX() * TILE_SIZE), Clamp(v->y_pos, 0, Map::MaxY() * TILE_SIZE));
v->z_pos -= 1;
if (v->z_pos == z) {
if (v->z_pos <= z) {
v->crashed_counter = 500;
v->z_pos++;
v->z_pos = z + 1;
} else {
v->crashed_counter = 0;
}
}