mirror of
https://github.com/halpz/re3.git
synced 2025-02-01 08:01:03 +00:00
Fix some auto-aim problems
This commit is contained in:
parent
8b7f469ae1
commit
0256790e1c
|
@ -205,9 +205,15 @@ CPedIK::PointGunInDirection(float targetYaw, float targetPitch)
|
||||||
else if (status == ANGLES_SET_EXACTLY)
|
else if (status == ANGLES_SET_EXACTLY)
|
||||||
m_flags |= GUN_POINTED_SUCCESSFULLY;
|
m_flags |= GUN_POINTED_SUCCESSFULLY;
|
||||||
}
|
}
|
||||||
RwMatrix *m = GetBoneMatrix(m_ped, BONE_spine); // BUG: game uses index 2 directly, which happens to be identical to BONE_spine
|
#ifdef FIX_BUGS
|
||||||
|
RwMatrix *m = GetBoneMatrix(m_ped, BONE_spine);
|
||||||
|
#else
|
||||||
|
RpHAnimHierarchy* hier = GetAnimHierarchyFromSkinClump(m_ped->GetClump());
|
||||||
|
RwMatrix *mats = RpHAnimHierarchyGetMatrixArray(hier);
|
||||||
|
RwMatrix *m = &mats[2];
|
||||||
|
#endif
|
||||||
RwV3d axis = { 0.0f, 0.0f, 0.0f };
|
RwV3d axis = { 0.0f, 0.0f, 0.0f };
|
||||||
float axisangle = -CGeneral::LimitRadianAngle(Atan2(-m->at.y, -m->at.x) - m_ped->m_fRotationCur);
|
float axisangle = -CGeneral::LimitRadianAngle(Atan2(-m->up.y, -m->up.x) - m_ped->m_fRotationCur);
|
||||||
axis.y = -Sin(axisangle);
|
axis.y = -Sin(axisangle);
|
||||||
axis.z = Cos(axisangle);
|
axis.z = Cos(axisangle);
|
||||||
|
|
||||||
|
|
|
@ -1057,7 +1057,7 @@ CPlayerPed::FindNextWeaponLockOnTarget(CEntity *previousTarget, bool lookToLeft)
|
||||||
// nextTarget = nil; // duplicate
|
// nextTarget = nil; // duplicate
|
||||||
float lastCloseness = -10000.0f;
|
float lastCloseness = -10000.0f;
|
||||||
// CGeneral::GetATanOfXY(GetForward().x, GetForward().y); // unused
|
// CGeneral::GetATanOfXY(GetForward().x, GetForward().y); // unused
|
||||||
CVector distVec = previousTarget->GetPosition() - GetPosition();
|
CVector distVec = previousTarget->GetPosition() - TheCamera.GetPosition();
|
||||||
float referenceBeta = CGeneral::GetATanOfXY(distVec.x, distVec.y);
|
float referenceBeta = CGeneral::GetATanOfXY(distVec.x, distVec.y);
|
||||||
|
|
||||||
for (int h = CPools::GetPedPool()->GetSize() - 1; h >= 0; h--) {
|
for (int h = CPools::GetPedPool()->GetSize() - 1; h >= 0; h--) {
|
||||||
|
@ -1069,7 +1069,7 @@ CPlayerPed::FindNextWeaponLockOnTarget(CEntity *previousTarget, bool lookToLeft)
|
||||||
&& (!pedToCheck->bInVehicle || (pedToCheck->m_pMyVehicle && pedToCheck->m_pMyVehicle->IsBike()))
|
&& (!pedToCheck->bInVehicle || (pedToCheck->m_pMyVehicle && pedToCheck->m_pMyVehicle->IsBike()))
|
||||||
#endif
|
#endif
|
||||||
&& pedToCheck->m_leader != this && !pedToCheck->bNeverEverTargetThisPed
|
&& pedToCheck->m_leader != this && !pedToCheck->bNeverEverTargetThisPed
|
||||||
&& OurPedCanSeeThisOne(pedToCheck) && CanIKReachThisTarget(pedToCheck->GetPosition(), GetWeapon(), true)) {
|
&& OurPedCanSeeThisOne(pedToCheck, true) && CanIKReachThisTarget(pedToCheck->GetPosition(), GetWeapon(), true)) {
|
||||||
|
|
||||||
EvaluateNeighbouringTarget(pedToCheck, &nextTarget, &lastCloseness,
|
EvaluateNeighbouringTarget(pedToCheck, &nextTarget, &lastCloseness,
|
||||||
weaponRange, referenceBeta, lookToLeft, IsThisPedAnAimingPriority(pedToCheck));
|
weaponRange, referenceBeta, lookToLeft, IsThisPedAnAimingPriority(pedToCheck));
|
||||||
|
@ -1195,7 +1195,7 @@ CPlayerPed::ProcessAnimGroups(void)
|
||||||
GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN)
|
GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN)
|
||||||
groupToSet = ASSOCGRP_PLAYERCHAINSAW;
|
groupToSet = ASSOCGRP_PLAYERCHAINSAW;
|
||||||
else if (GetWeapon()->m_eWeaponType != WEAPONTYPE_COLT45 && GetWeapon()->m_eWeaponType != WEAPONTYPE_UZI
|
else if (GetWeapon()->m_eWeaponType != WEAPONTYPE_COLT45 && GetWeapon()->m_eWeaponType != WEAPONTYPE_UZI
|
||||||
// I hope this is a inlined function...
|
// I hope this is an inlined function...
|
||||||
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_PYTHON && GetWeapon()->m_eWeaponType != WEAPONTYPE_TEC9
|
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_PYTHON && GetWeapon()->m_eWeaponType != WEAPONTYPE_TEC9
|
||||||
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_SILENCED_INGRAM && GetWeapon()->m_eWeaponType != WEAPONTYPE_MP5
|
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_SILENCED_INGRAM && GetWeapon()->m_eWeaponType != WEAPONTYPE_MP5
|
||||||
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_GOLFCLUB && GetWeapon()->m_eWeaponType != WEAPONTYPE_KATANA
|
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_GOLFCLUB && GetWeapon()->m_eWeaponType != WEAPONTYPE_KATANA
|
||||||
|
|
Loading…
Reference in a new issue