Skip to content

Commit 5e3843c

Browse files
committed
Fix healthbar sometimes showing up in the main menu
1 parent a9748c1 commit 5e3843c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/healthbars.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,19 @@ void HealthbarRenderer::UpdateState()
269269
D3DXMatrixInverse(&projMat, NULL, viewMat);
270270
D3DXMatrixMultiply(&projMat, &projMat, viewProjMat);
271271

272+
pursuitActive = false;
272273
void* soundAi = DEREF(0x993cc8, 0);
273274
if (soundAi) {
274275
void* pursuitAi = DEREF(soundAi, 0x130);
275276
pursuitActive = pursuitAi != nullptr;
276-
if (pursuitActive) {
277-
pursuitActiveCounter += *deltaTime;
278-
}
279-
else {
280-
pursuitActiveCounter = 0;
281-
}
277+
}
278+
279+
if (pursuitActive) {
280+
pursuitActiveCounter += *deltaTime;
281+
}
282+
else {
283+
pursuitActiveCounter = 0;
284+
copCars.clear();
282285
}
283286

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

0 commit comments

Comments
 (0)