Merge remote-tracking branch 'upstream/lcs' into lcs

This commit is contained in:
Nikolay Korolev 2021-07-25 21:44:31 +03:00
commit c7d3b88cb7
5 changed files with 29 additions and 15 deletions

View file

@ -1928,7 +1928,7 @@ bool CRunningScript::CheckDamagedWeaponType(int32 actual, int32 type)
if (type == WEAPONTYPE_ANYMELEE) { if (type == WEAPONTYPE_ANYMELEE) {
if (actual <= WEAPONTYPE_CHAINSAW) if (actual <= WEAPONTYPE_CHAINSAW)
return true; return true;
if (actual - WEAPONTYPE_GRENADE <= WEAPONTYPE_MINIGUN) if (actual >= WEAPONTYPE_GRENADE && actual <= WEAPONTYPE_UNIDENTIFIED)
return false; return false;
return false; return false;
} }

View file

@ -54,7 +54,7 @@ public:
int32 m_nUpsideDownCounter; int32 m_nUpsideDownCounter;
int32 field_EC; int32 field_EC;
int32 m_nTimeCarSpentOnTwoWheels; int32 m_nTimeCarSpentOnTwoWheels;
int32 m_nDistanceCarTravelledOnTwoWheels; float m_nDistanceCarTravelledOnTwoWheels;
int32 m_nTimeNotFullyOnGround; int32 m_nTimeNotFullyOnGround;
int32 m_nTimeSpentOnWheelie; int32 m_nTimeSpentOnWheelie;
float m_nDistanceTravelledOnWheelie; float m_nDistanceTravelledOnWheelie;
@ -62,11 +62,11 @@ public:
float m_nDistanceTravelledOnStoppie; float m_nDistanceTravelledOnStoppie;
int32 m_nCancelWheelStuntTimer; int32 m_nCancelWheelStuntTimer;
int32 m_nLastTimeCarSpentOnTwoWheels; int32 m_nLastTimeCarSpentOnTwoWheels;
int32 m_nLastDistanceCarTravelledOnTwoWheels; float m_nLastDistanceCarTravelledOnTwoWheels;
int32 m_nLastTimeSpentOnWheelie; int32 m_nLastTimeSpentOnWheelie;
int32 m_nLastDistanceTravelledOnWheelie; float m_nLastDistanceTravelledOnWheelie;
int32 m_nLastTimeSpentOnStoppie; int32 m_nLastTimeSpentOnStoppie;
int32 m_nLastDistanceTravelledOnStoppie; float m_nLastDistanceTravelledOnStoppie;
int16 m_nTrafficMultiplier; int16 m_nTrafficMultiplier;
int16 field_12A; int16 field_12A;
float m_fRoadDensity; float m_fRoadDensity;

View file

@ -354,6 +354,14 @@ CPed::SetAttack(CEntity *victim)
SetAimFlag(m_fRotationCur); 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) { if (m_nPedState == PED_ATTACK) {
bIsAttacking = true; bIsAttacking = true;
return; return;

View file

@ -36,6 +36,12 @@
#define SCALE_AND_CENTER_X_FIX(a) (a) #define SCALE_AND_CENTER_X_FIX(a) (a)
#endif #endif
#ifdef FIX_BUGS
#define FRAMECOUNTER CTimer::GetLogicalFrameCounter()
#else
#define FRAMECOUNTER CTimer::GetFrameCounter()
#endif
// Game has colors inlined in code. // Game has colors inlined in code.
// For easier modification we collect them here: // For easier modification we collect them here:
CRGBA MONEY_COLOR(0, 207, 133, 255); CRGBA MONEY_COLOR(0, 207, 133, 255);
@ -575,12 +581,12 @@ void CHud::Draw()
CFont::SetDropShadowPosition(2); CFont::SetDropShadowPosition(2);
CFont::SetDropColor(CRGBA(0, 0, 0, 255)); 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 || m_ItemToFlash != ITEM_HEALTH
|| playerPed->m_fHealth < 10 || playerPed->m_fHealth < 10
&& CTimer::GetFrameCounter() & 8) { && FRAMECOUNTER & 8) {
if (playerPed->m_fHealth >= 10 if (playerPed->m_fHealth >= 10
|| playerPed->m_fHealth < 10 && CTimer::GetFrameCounter() & 8) { || playerPed->m_fHealth < 10 && FRAMECOUNTER & 8) {
if (FrontEndMenuManager.m_PrefsShowHud) { if (FrontEndMenuManager.m_PrefsShowHud) {
DrawHealthBar(playerPed->m_fHealth); DrawHealthBar(playerPed->m_fHealth);
} }
@ -590,7 +596,7 @@ void CHud::Draw()
/* /*
DrawArmour 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)); CFont::SetScale(SCREEN_SCALE_X(HUD_TEXT_SCALE_X), SCREEN_SCALE_Y(HUD_TEXT_SCALE_Y));
if (playerPed->m_fArmour > 1.0f) { if (playerPed->m_fArmour > 1.0f) {
AsciiToUnicode("<", sPrintIcon); AsciiToUnicode("<", sPrintIcon);
@ -626,11 +632,11 @@ void CHud::Draw()
if (FrontEndMenuManager.m_PrefsShowHud) { if (FrontEndMenuManager.m_PrefsShowHud) {
if (playerPed->m_pWanted->GetWantedLevel() > i if (playerPed->m_pWanted->GetWantedLevel() > i
&& (CTimer::GetTimeInMilliseconds() > playerPed->m_pWanted->m_nLastWantedLevelChange && (CTimer::GetTimeInMilliseconds() > playerPed->m_pWanted->m_nLastWantedLevelChange
+ 2000 || CTimer::GetFrameCounter() & 4)) { + 2000 || FRAMECOUNTER & 4)) {
DrawTimeAndCashNumbers(wantedStar, starX, 63.0f, false); 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); DrawTimeAndCashNumbers(wantedStar, starX, 63.0f, true);
} }
if (FrontEndMenuManager.m_PrefsUseWideScreen) if (FrontEndMenuManager.m_PrefsUseWideScreen)
@ -928,7 +934,7 @@ void CHud::Draw()
TimerFlashTimer = 0; TimerFlashTimer = 0;
} }
if (CTimer::GetFrameCounter() & 4 || TimerFlashTimer == 0) { if (FRAMECOUNTER & 4 || TimerFlashTimer == 0) {
AsciiToUnicode(CUserDisplay::OnscnTimer.m_sClocks[0].m_aClockBuffer, sTimer); AsciiToUnicode(CUserDisplay::OnscnTimer.m_sClocks[0].m_aClockBuffer, sTimer);
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
@ -966,7 +972,7 @@ void CHud::Draw()
CounterFlashTimer[i] = 0; 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) { if (CUserDisplay::OnscnTimer.m_sCounters[i].m_nType == COUNTER_DISPLAY_NUMBER) {
AsciiToUnicode(CUserDisplay::OnscnTimer.m_sCounters[i].m_aCounterBuffer, sTimer); AsciiToUnicode(CUserDisplay::OnscnTimer.m_sCounters[i].m_aCounterBuffer, sTimer);
CFont::SetPropOn(); CFont::SetPropOn();
@ -1021,7 +1027,7 @@ void CHud::Draw()
DrawRadar DrawRadar
*/ */
if (FrontEndMenuManager.m_PrefsRadarMode != 2 && 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); RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERNEAREST);
CRadar::DrawMap(); CRadar::DrawMap();

View file

@ -478,7 +478,7 @@ DoGameSpecificStuffAfterSucessLoad()
CGame::TidyUpMemory(true, false); CGame::TidyUpMemory(true, false);
StillToFadeOut = true; StillToFadeOut = true;
JustLoadedDontFadeInYet = true; JustLoadedDontFadeInYet = true;
TheCamera.Fade(0.0f, 0); TheCamera.Fade(0.0f, FADE_OUT);
CTheScripts::Process(); CTheScripts::Process();
} }