mirror of https://github.com/Nofated095/re-GTA.git
Fix damage bar assert crash
This commit is contained in:
parent
6e73d9220a
commit
e2f8ad983d
|
@ -151,9 +151,6 @@ void COnscreenTimerEntry::ProcessForDisplayClock() {
|
|||
|
||||
void COnscreenTimerEntry::ProcessForDisplayCounter() {
|
||||
uint32 counter = *(uint32*)&CTheScripts::ScriptSpace[m_nCounterOffset];
|
||||
|
||||
assert(!m_nType || counter <= 100);
|
||||
|
||||
sprintf(m_bCounterBuffer, "%d", counter);
|
||||
}
|
||||
|
||||
|
|
|
@ -702,8 +702,12 @@ void CHud::Draw()
|
|||
|
||||
if (CTimer::GetFrameCounter() & 4 || !CounterFlashTimer) {
|
||||
if (CUserDisplay::OnscnTimer.m_sEntries[0].m_nType) {
|
||||
int counter = atoi(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer);
|
||||
#ifdef FIX_BUGS
|
||||
counter = min(counter, 100);
|
||||
#endif
|
||||
CSprite2d::DrawRect(CRect(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f), SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(11.0f) + SCREEN_SCALE_Y(8.0f)), CRGBA(0, 106, 164, 80));
|
||||
CSprite2d::DrawRect(CRect(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f), SCREEN_SCALE_X(atoi(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer) / 2.0f) + SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET + 50.0f) + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(11.0f) + SCREEN_SCALE_Y(8.0f)), CRGBA(0, 106, 164, 255));
|
||||
CSprite2d::DrawRect(CRect(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f), SCREEN_SCALE_X(counter) / 2.0f + SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET + 50.0f) + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(11.0f) + SCREEN_SCALE_Y(8.0f)), CRGBA(0, 106, 164, 255));
|
||||
} else {
|
||||
AsciiToUnicode(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer, sTimer);
|
||||
CFont::SetPropOn();
|
||||
|
|
Loading…
Reference in New Issue