From f96937a73e4387cc517996fad330720e43545084 Mon Sep 17 00:00:00 2001 From: vrockwave Date: Mon, 30 Jun 2025 02:56:33 -0700 Subject: [PATCH] fixes --- src/control/Script.cpp | 7 +++---- src/core/config.h | 2 +- src/entities/Physical.cpp | 2 +- src/peds/PlayerPed.cpp | 2 +- src/weapons/Weapon.cpp | 6 ++---- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/control/Script.cpp b/src/control/Script.cpp index a2dd8512..b4459be0 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -2711,10 +2711,9 @@ int8 CRunningScript::ProcessCommands200To299(int32 command) CollectParameters(&m_nIp, 1); CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]); script_assert(ped); - CVehicle* pCurrent = nil; - if (ped->bInVehicle) { - pCurrent = ped->m_pMyVehicle; - } + if(!ped->bInVehicle) + return 0; + CVehicle* pCurrent = ped->m_pMyVehicle; script_assert(pCurrent); // GetIndex(0) doesn't look good int handle = CPools::GetVehiclePool()->GetIndex(pCurrent); if (handle != CTheScripts::StoreVehicleIndex && m_bIsMissionScript){ diff --git a/src/core/config.h b/src/core/config.h index 54f16628..f6f005a7 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -371,7 +371,7 @@ enum Config { #define LEGACY_MENU_OPTIONS // i.e. frame sync(vsync) #define MUCH_SHORTER_OUTRO_SCREEN // #define XBOX_MESSAGE_SCREEN // Blue background, no "saved successfully press OK" screen etc. -# define CUSTOM_FRONTEND_OPTIONS +#define CUSTOM_FRONTEND_OPTIONS # ifdef CUSTOM_FRONTEND_OPTIONS # define GRAPHICS_MENU_OPTIONS // otherwise Display settings will be scrollable diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp index fb796fcd..22e822f2 100644 --- a/src/entities/Physical.cpp +++ b/src/entities/Physical.cpp @@ -236,7 +236,7 @@ CPhysical::GetBoundRect(void) void CPhysical::AddToMovingList(void) { - if (!bIsStaticWaitingForCollision) + if(!bIsStaticWaitingForCollision && !CWorld::GetMovingEntityList().FindItem(this)) m_movingListNode = CWorld::GetMovingEntityList().InsertItem(this); } diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp index b3fe0ff0..cd8da425 100644 --- a/src/peds/PlayerPed.cpp +++ b/src/peds/PlayerPed.cpp @@ -1369,7 +1369,7 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed) SetAimFlag(limitedCam); SetLookTimer(INT32_MAX); ((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch(); - if (m_nPedState != PED_ATTACK && m_nPedState != PED_AIM_GUN) { + if (m_nPedState != PED_ATTACK && m_nPedState != PED_AIM_GUN && m_nPedState != PED_FIGHT) { // This is a seperate ped state just for pointing gun. Used for target button SetPointGunAt(nil); } diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index 2d219e2d..cada1681 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -1587,15 +1587,13 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim, if ( !victimObject->bInfiniteMass && victimObject->m_fCollisionDamageMultiplier < 99.9f) { - bool notStatic = !victimObject->GetIsStatic(); - if (notStatic && victimObject->m_fUprootLimit <= 0.0f) + if(victimObject->GetIsStatic() && victimObject->m_fUprootLimit <= 0.0f) { victimObject->SetIsStatic(false); victimObject->AddToMovingList(); } - notStatic = !victimObject->GetIsStatic(); - if (!notStatic) + if(!victimObject->GetIsStatic()) { CVector moveForce = point->normal * -4.0f; victimObject->ApplyMoveForce(moveForce.x, moveForce.y, moveForce.z);