summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authorNikolay <nickvnuk@gmail.com>2020-12-19 17:15:52 +0100
committerGitHub <noreply@github.com>2020-12-19 17:15:52 +0100
commit867133e93d57dba5319bb13abeeb3f73bbaf6ae1 (patch)
treee16891b3bd62f38bc959c295ebeca1aa6b9952d7 /src/peds
parentsilly mistake (diff)
parentfixed cmakelists (diff)
downloadre3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar
re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.gz
re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.bz2
re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.lz
re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.xz
re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.zst
re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.zip
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/Ped.cpp21
-rw-r--r--src/peds/Ped.h11
-rw-r--r--src/peds/PlayerPed.cpp3
3 files changed, 16 insertions, 19 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index b402b2fe..392ee1d4 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -2664,19 +2664,19 @@ CPed::ProcessControl(void)
Flee();
break;
case PED_FOLLOW_PATH:
- CPed::FollowPath();
+ FollowPath();
break;
case PED_PAUSE:
- CPed::Pause();
+ Pause();
break;
case PED_ATTACK:
- CPed::Attack();
+ Attack();
break;
case PED_FIGHT:
- CPed::Fight();
+ Fight();
break;
case PED_CHAT:
- CPed::Chat();
+ Chat();
break;
case PED_AIM_GUN:
if (m_pPointGunAt && m_pPointGunAt->IsPed()
@@ -9697,17 +9697,6 @@ CPed::Say(uint16 audio, int32 time)
}
}
-void
-CPed::SetWeaponLockOnTarget(CEntity *target)
-{
- if (m_pPointGunAt)
- m_pPointGunAt->CleanUpOldReference(&m_pPointGunAt);
-
- m_pPointGunAt = (CPed*)target;
- if (target)
- ((CEntity*)target)->RegisterReference(&m_pPointGunAt);
-}
-
#ifdef COMPATIBLE_SAVES
#define CopyFromBuf(buf, data) memcpy(&data, buf, sizeof(data)); SkipSaveBuf(buf, sizeof(data));
#define CopyToBuf(buf, data) memcpy(buf, &data, sizeof(data)); SkipSaveBuf(buf, sizeof(data));
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index fb44f59c..5683c7c9 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -866,7 +866,6 @@ public:
void PositionAttachedPed();
bool CanUseTorsoWhenLooking();
void ScanForDelayedResponseThreats();
- void SetWeaponLockOnTarget(CEntity*);
// Static methods
static CVector GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float offset);
@@ -1104,6 +1103,16 @@ public:
}
// --
+ inline void SetWeaponLockOnTarget(CEntity *target)
+ {
+ if (m_pPointGunAt)
+ m_pPointGunAt->CleanUpOldReference(&m_pPointGunAt);
+
+ m_pPointGunAt = (CPed*)target;
+ if (target)
+ ((CEntity*)target)->RegisterReference(&m_pPointGunAt);
+ }
+
// Using this to abstract nodes of skinned and non-skinned meshes
CVector GetNodePosition(int32 node)
{
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index 62559443..74db3055 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -1496,8 +1496,7 @@ CPlayerPed::PlayerControlZelda(CPad *padUsed)
if (m_nPedState == PED_JUMP) {
if (bIsInTheAir) {
- if (bUsesCollision && !bHitSteepSlope &&
- (!bHitSomethingLastFrame || m_vecDamageNormal.z > 0.6f)
+ if (bUsesCollision && !bHitSteepSlope && (!bHitSomethingLastFrame || m_vecDamageNormal.z > 0.6f)
&& m_fDistanceTravelled < CTimer::GetTimeStep() * 0.02 && m_vecMoveSpeed.MagnitudeSqr() < 0.01f) {
float angleSin = Sin(m_fRotationCur); // originally sin(DEGTORAD(RADTODEG(m_fRotationCur))) o_O