summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-06-01 23:21:07 +0200
committerGitHub <noreply@github.com>2020-06-01 23:21:07 +0200
commit03d9525eb63d79f11337ccfc1bef120ccd75b995 (patch)
tree283827c8842040d50c2c77a67878974bc4c03d9d /src/peds
parentadd freeroam; clean up debug menu (diff)
parentMerge branch 'miami' of https://github.com/GTAmodding/re3 into miami (diff)
downloadre3-03d9525eb63d79f11337ccfc1bef120ccd75b995.tar
re3-03d9525eb63d79f11337ccfc1bef120ccd75b995.tar.gz
re3-03d9525eb63d79f11337ccfc1bef120ccd75b995.tar.bz2
re3-03d9525eb63d79f11337ccfc1bef120ccd75b995.tar.lz
re3-03d9525eb63d79f11337ccfc1bef120ccd75b995.tar.xz
re3-03d9525eb63d79f11337ccfc1bef120ccd75b995.tar.zst
re3-03d9525eb63d79f11337ccfc1bef120ccd75b995.zip
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/Ped.cpp48
-rw-r--r--src/peds/PlayerPed.cpp2
2 files changed, 12 insertions, 38 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index e60d702b..c2c272bf 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -8662,6 +8662,7 @@ CPed::HaveReachedNextPointOnRoute(float distToCountReached)
return true;
}
+// --MIAMI: Done
void
CPed::Idle(void)
{
@@ -8683,39 +8684,9 @@ CPed::Idle(void)
}
}
- CAnimBlendAssociation *armedIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_ARMED);
- CAnimBlendAssociation *unarmedIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE);
- int waitTime;
-
- if (m_nMoveState == PEDMOVE_STILL) {
-
- eWeaponType curWeapon = GetWeapon()->m_eWeaponType;
- if (!armedIdleAssoc ||
- CTimer::GetTimeInMilliseconds() <= m_nWaitTimer && curWeapon != WEAPONTYPE_UNARMED && curWeapon != WEAPONTYPE_MOLOTOV && curWeapon != WEAPONTYPE_GRENADE) {
-
- if ((!GetWeapon()->IsType2Handed() || curWeapon == WEAPONTYPE_SHOTGUN) && curWeapon != WEAPONTYPE_BASEBALLBAT
- || !unarmedIdleAssoc || unarmedIdleAssoc->blendAmount <= 0.95f || m_nWaitState != WAITSTATE_FALSE || CTimer::GetTimeInMilliseconds() <= m_nWaitTimer) {
+ if (m_nMoveState != PEDMOVE_STILL && !IsPlayer())
+ SetMoveState(PEDMOVE_STILL);
- m_moved = CVector2D(0.0f, 0.0f);
- return;
- }
- CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_IDLE_ARMED, 3.0f);
- waitTime = CGeneral::GetRandomNumberInRange(4000, 7500);
- } else {
- armedIdleAssoc->blendDelta = -2.0f;
- armedIdleAssoc->flags |= ASSOC_DELETEFADEDOUT;
- waitTime = CGeneral::GetRandomNumberInRange(3000, 8500);
- }
- m_nWaitTimer = CTimer::GetTimeInMilliseconds() + waitTime;
- } else {
- if (armedIdleAssoc) {
- armedIdleAssoc->blendDelta = -8.0f;
- armedIdleAssoc->flags |= ASSOC_DELETEFADEDOUT;
- m_nWaitTimer = 0;
- }
- if (!IsPlayer())
- SetMoveState(PEDMOVE_STILL);
- }
m_moved = CVector2D(0.0f, 0.0f);
}
@@ -17861,10 +17832,11 @@ CPed::SetObjective(eObjective newObj, CVector dest)
}
}
+// --MIAMI: Done
void
CPed::SetMoveAnim(void)
{
- if (m_nStoredMoveState == m_nMoveState || !IsPedInControl())
+ if (m_nStoredMoveState == m_nMoveState || !IsPedInControl() || m_attachedTo)
return;
if (m_nMoveState == PEDMOVE_NONE) {
@@ -17880,12 +17852,14 @@ CPed::SetMoveAnim(void)
CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_BLOCK);
if (!animAssoc) {
- CAnimBlendAssociation *fightIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE);
- animAssoc = fightIdleAssoc;
- if (fightIdleAssoc && m_nPedState == PED_FIGHT)
+ animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE);
+ if (!animAssoc)
+ animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_CROUCHRELOAD);
+
+ if (animAssoc && m_nPedState == PED_FIGHT)
return;
- if (fightIdleAssoc) {
+ if (animAssoc) {
CAnimBlendAssociation *idleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE);
if (!idleAssoc || idleAssoc->blendDelta <= 0.0f) {
animAssoc->flags |= ASSOC_DELETEFADEDOUT;
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index 3896efa5..a24c7fa3 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -1007,7 +1007,7 @@ CPlayerPed::FindWeaponLockOnTarget(void)
return true;
}
-// --MIAMI: Done, but uncomment new weapon types when weapons got ported
+// --MIAMI: Done
void
CPlayerPed::ProcessAnimGroups(void)
{