diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/control/Script5.cpp | 2 | ||||
-rw-r--r-- | src/core/PlayerInfo.h | 8 | ||||
-rw-r--r-- | src/peds/PedFight.cpp | 8 | ||||
-rw-r--r-- | src/renderer/Hud.cpp | 24 | ||||
-rw-r--r-- | src/save/GenericGameStorage.cpp | 2 |
5 files changed, 29 insertions, 15 deletions
diff --git a/src/control/Script5.cpp b/src/control/Script5.cpp index c5d316a3..8544f604 100644 --- a/src/control/Script5.cpp +++ b/src/control/Script5.cpp @@ -1928,7 +1928,7 @@ bool CRunningScript::CheckDamagedWeaponType(int32 actual, int32 type) if (type == WEAPONTYPE_ANYMELEE) { if (actual <= WEAPONTYPE_CHAINSAW) return true; - if (actual - WEAPONTYPE_GRENADE <= WEAPONTYPE_MINIGUN) + if (actual >= WEAPONTYPE_GRENADE && actual <= WEAPONTYPE_UNIDENTIFIED) return false; return false; } diff --git a/src/core/PlayerInfo.h b/src/core/PlayerInfo.h index a24185f0..fc12267d 100644 --- a/src/core/PlayerInfo.h +++ b/src/core/PlayerInfo.h @@ -54,7 +54,7 @@ public: int32 m_nUpsideDownCounter; int32 field_EC; int32 m_nTimeCarSpentOnTwoWheels; - int32 m_nDistanceCarTravelledOnTwoWheels; + float m_nDistanceCarTravelledOnTwoWheels; int32 m_nTimeNotFullyOnGround; int32 m_nTimeSpentOnWheelie; float m_nDistanceTravelledOnWheelie; @@ -62,11 +62,11 @@ public: float m_nDistanceTravelledOnStoppie; int32 m_nCancelWheelStuntTimer; int32 m_nLastTimeCarSpentOnTwoWheels; - int32 m_nLastDistanceCarTravelledOnTwoWheels; + float m_nLastDistanceCarTravelledOnTwoWheels; int32 m_nLastTimeSpentOnWheelie; - int32 m_nLastDistanceTravelledOnWheelie; + float m_nLastDistanceTravelledOnWheelie; int32 m_nLastTimeSpentOnStoppie; - int32 m_nLastDistanceTravelledOnStoppie; + float m_nLastDistanceTravelledOnStoppie; int16 m_nTrafficMultiplier; int16 field_12A; float m_fRoadDensity; diff --git a/src/peds/PedFight.cpp b/src/peds/PedFight.cpp index 7ec8b7dd..6fd1e949 100644 --- a/src/peds/PedFight.cpp +++ b/src/peds/PedFight.cpp @@ -354,6 +354,14 @@ CPed::SetAttack(CEntity *victim) SetAimFlag(m_fRotationCur); } } +#ifdef FIX_BUGS + // fix aiming for flamethrower and minigun while using PC controls + else if (curWeapon->m_AnimToPlay == ASSOCGRP_FLAMETHROWER && TheCamera.Cams[0].Using3rdPersonMouseCam() && this == FindPlayerPed()) + { + SetAimFlag(m_fRotationCur); + ((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch(); + } +#endif if (m_nPedState == PED_ATTACK) { bIsAttacking = true; return; diff --git a/src/renderer/Hud.cpp b/src/renderer/Hud.cpp index f6374cf5..5c0db44c 100644 --- a/src/renderer/Hud.cpp +++ b/src/renderer/Hud.cpp @@ -36,6 +36,12 @@ #define SCALE_AND_CENTER_X_FIX(a) (a) #endif +#ifdef FIX_BUGS +#define FRAMECOUNTER CTimer::GetLogicalFrameCounter() +#else +#define FRAMECOUNTER CTimer::GetFrameCounter() +#endif + // Game has colors inlined in code. // For easier modification we collect them here: CRGBA MONEY_COLOR(0, 207, 133, 255); @@ -575,12 +581,12 @@ void CHud::Draw() CFont::SetDropShadowPosition(2); CFont::SetDropColor(CRGBA(0, 0, 0, 255)); - if (m_ItemToFlash == ITEM_HEALTH && CTimer::GetFrameCounter() & 8 + if (m_ItemToFlash == ITEM_HEALTH && FRAMECOUNTER & 8 || m_ItemToFlash != ITEM_HEALTH || playerPed->m_fHealth < 10 - && CTimer::GetFrameCounter() & 8) { + && FRAMECOUNTER & 8) { if (playerPed->m_fHealth >= 10 - || playerPed->m_fHealth < 10 && CTimer::GetFrameCounter() & 8) { + || playerPed->m_fHealth < 10 && FRAMECOUNTER & 8) { if (FrontEndMenuManager.m_PrefsShowHud) { DrawHealthBar(playerPed->m_fHealth); } @@ -590,7 +596,7 @@ void CHud::Draw() /* DrawArmour */ - if (m_ItemToFlash == ITEM_ARMOUR && CTimer::GetFrameCounter() & 8 || m_ItemToFlash != ITEM_ARMOUR) { + if (m_ItemToFlash == ITEM_ARMOUR && FRAMECOUNTER & 8 || m_ItemToFlash != ITEM_ARMOUR) { CFont::SetScale(SCREEN_SCALE_X(HUD_TEXT_SCALE_X), SCREEN_SCALE_Y(HUD_TEXT_SCALE_Y)); if (playerPed->m_fArmour > 1.0f) { AsciiToUnicode("<", sPrintIcon); @@ -626,11 +632,11 @@ void CHud::Draw() if (FrontEndMenuManager.m_PrefsShowHud) { if (playerPed->m_pWanted->GetWantedLevel() > i && (CTimer::GetTimeInMilliseconds() > playerPed->m_pWanted->m_nLastWantedLevelChange - + 2000 || CTimer::GetFrameCounter() & 4)) { + + 2000 || FRAMECOUNTER & 4)) { DrawTimeAndCashNumbers(wantedStar, starX, 63.0f, false); - } else if (playerPed->m_pWanted->m_nMinWantedLevel > i && CTimer::GetFrameCounter() & 4) { + } else if (playerPed->m_pWanted->m_nMinWantedLevel > i && FRAMECOUNTER & 4) { DrawTimeAndCashNumbers(wantedStar, starX, 63.0f, true); } if (FrontEndMenuManager.m_PrefsUseWideScreen) @@ -928,7 +934,7 @@ void CHud::Draw() TimerFlashTimer = 0; } - if (CTimer::GetFrameCounter() & 4 || TimerFlashTimer == 0) { + if (FRAMECOUNTER & 4 || TimerFlashTimer == 0) { AsciiToUnicode(CUserDisplay::OnscnTimer.m_sClocks[0].m_aClockBuffer, sTimer); CFont::SetPropOn(); CFont::SetBackgroundOff(); @@ -966,7 +972,7 @@ void CHud::Draw() CounterFlashTimer[i] = 0; } - if (CTimer::GetFrameCounter() & 4 || CounterFlashTimer[i] == 0) { + if (FRAMECOUNTER & 4 || CounterFlashTimer[i] == 0) { if (CUserDisplay::OnscnTimer.m_sCounters[i].m_nType == COUNTER_DISPLAY_NUMBER) { AsciiToUnicode(CUserDisplay::OnscnTimer.m_sCounters[i].m_aCounterBuffer, sTimer); CFont::SetPropOn(); @@ -1021,7 +1027,7 @@ void CHud::Draw() DrawRadar */ if (FrontEndMenuManager.m_PrefsRadarMode != 2 && - !m_HideRadar && (m_ItemToFlash == ITEM_RADAR && CTimer::GetFrameCounter() & 8 || m_ItemToFlash != ITEM_RADAR)) { + !m_HideRadar && (m_ItemToFlash == ITEM_RADAR && FRAMECOUNTER & 8 || m_ItemToFlash != ITEM_RADAR)) { RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERNEAREST); CRadar::DrawMap(); diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp index 8095794b..d2fbb9b0 100644 --- a/src/save/GenericGameStorage.cpp +++ b/src/save/GenericGameStorage.cpp @@ -478,7 +478,7 @@ DoGameSpecificStuffAfterSucessLoad() CGame::TidyUpMemory(true, false); StillToFadeOut = true; JustLoadedDontFadeInYet = true; - TheCamera.Fade(0.0f, 0); + TheCamera.Fade(0.0f, FADE_OUT); CTheScripts::Process(); } |