Cache whether vehicle is currently drawn: Vehicle::IsDrawn()

This commit is contained in:
Jonathan G Rennison
2020-02-02 22:59:18 +00:00
parent 81a67b5b24
commit 76f68c48f5
13 changed files with 46 additions and 5 deletions

View File

@@ -577,9 +577,11 @@ void HandleAircraftEnterHangar(Aircraft *v)
Aircraft *u = v->Next();
u->vehstatus |= VS_HIDDEN;
u->UpdateIsDrawn();
u = u->Next();
if (u != nullptr) {
u->vehstatus |= VS_HIDDEN;
u->UpdateIsDrawn();
u->cur_speed = 0;
}
@@ -1493,14 +1495,17 @@ void AircraftLeaveHangar(Aircraft *v, Direction exit_dir)
v->progress = 0;
v->direction = exit_dir;
v->vehstatus &= ~VS_HIDDEN;
v->UpdateIsDrawn();
{
Vehicle *u = v->Next();
u->vehstatus &= ~VS_HIDDEN;
u->UpdateIsDrawn();
/* Rotor blades */
u = u->Next();
if (u != nullptr) {
u->vehstatus &= ~VS_HIDDEN;
u->UpdateIsDrawn();
u->cur_speed = 80;
}
}