Skip to content

Commit

Permalink
Fix healthbar sometimes showing up in the main menu
Browse files Browse the repository at this point in the history
  • Loading branch information
trelbutate committed Jul 27, 2024
1 parent a9748c1 commit 5e3843c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/healthbars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,19 @@ void HealthbarRenderer::UpdateState()
D3DXMatrixInverse(&projMat, NULL, viewMat);
D3DXMatrixMultiply(&projMat, &projMat, viewProjMat);

pursuitActive = false;
void* soundAi = DEREF(0x993cc8, 0);
if (soundAi) {
void* pursuitAi = DEREF(soundAi, 0x130);
pursuitActive = pursuitAi != nullptr;
if (pursuitActive) {
pursuitActiveCounter += *deltaTime;
}
else {
pursuitActiveCounter = 0;
}
}

if (pursuitActive) {
pursuitActiveCounter += *deltaTime;
}
else {
pursuitActiveCounter = 0;
copCars.clear();
}

// Figure out if "Game moment camera" is enabled in the options to determine when to start showing healthbars on pursuit start
Expand Down

0 comments on commit 5e3843c

Please sign in to comment.