Merge branch 'miami' of github.com:GTAmodding/re3 into miami

This commit is contained in:
aap 2020-12-21 12:34:36 +01:00
commit f251803f55
3 changed files with 62 additions and 51 deletions

View File

@ -2583,39 +2583,15 @@ CPed::ProcessControl(void)
if (m_nWaitState != WAITSTATE_FALSE) if (m_nWaitState != WAITSTATE_FALSE)
Wait(); Wait();
switch (m_nPedState) {
case PED_IDLE:
Idle();
break;
case PED_LOOK_ENTITY:
case PED_LOOK_HEADING:
Look();
break;
case PED_WANDER_RANGE:
// III has these in here(and they were unused):
/*
WanderRange();
CheckAroundForPossibleCollisions();
*/
break;
case PED_WANDER_PATH:
WanderPath();
break;
case PED_ENTER_CAR:
case PED_CARJACK:
{
#ifdef CANCELLABLE_CAR_ENTER #ifdef CANCELLABLE_CAR_ENTER
if (!IsPlayer() || !m_pVehicleAnim) static bool cancelJack = false;
break; if (IsPlayer()) {
if (EnteringCar() && m_pVehicleAnim) {
CPad *pad = CPad::GetPad(0); CPad *pad = CPad::GetPad(0);
if (pad->ArePlayerControlsDisabled()) if (!pad->ArePlayerControlsDisabled()) {
break;
int vehAnim = m_pVehicleAnim->animId; int vehAnim = m_pVehicleAnim->animId;
static bool cancelJack = false;
int16 padWalkX = pad->GetPedWalkLeftRight(); int16 padWalkX = pad->GetPedWalkLeftRight();
int16 padWalkY = pad->GetPedWalkUpDown(); int16 padWalkY = pad->GetPedWalkUpDown();
if (Abs(padWalkX) > 0.0f || Abs(padWalkY) > 0.0f) { if (Abs(padWalkX) > 0.0f || Abs(padWalkY) > 0.0f) {
@ -2643,7 +2619,33 @@ CPed::ProcessControl(void)
cancelJack = false; cancelJack = false;
bCancelEnteringCar = true; bCancelEnteringCar = true;
} }
}
} else
cancelJack = false;
}
#endif #endif
switch (m_nPedState) {
case PED_IDLE:
Idle();
break;
case PED_LOOK_ENTITY:
case PED_LOOK_HEADING:
Look();
break;
case PED_WANDER_RANGE:
// III has these in here(and they were unused):
/*
WanderRange();
CheckAroundForPossibleCollisions();
*/
break;
case PED_WANDER_PATH:
WanderPath();
break;
case PED_ENTER_CAR:
case PED_CARJACK:
{
break; break;
} }
case PED_FLEE_POS: case PED_FLEE_POS:

View File

@ -5899,17 +5899,21 @@ CPed::Duck(void)
ClearDuck(); ClearDuck();
else if (bIsDucking && bCrouchWhenShooting) { else if (bIsDucking && bCrouchWhenShooting) {
CWeaponInfo *weapon = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType); CWeaponInfo *weapon = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType);
CAnimBlendAssociation *attackAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_CROUCH); CAnimBlendAssociation *crouchAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_WEAPON_CROUCH);
if (!attackAssoc) { if (!crouchAnim) {
if(GetCrouchFireAnim(weapon)) if(GetCrouchFireAnim(weapon))
attackAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(weapon)); crouchAnim = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchFireAnim(weapon));
} }
if (!attackAssoc) { if (!crouchAnim) {
if(GetCrouchReloadAnim(weapon)) if(GetCrouchReloadAnim(weapon))
attackAssoc = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchReloadAnim(weapon)); crouchAnim = RpAnimBlendClumpGetAssociation(GetClump(), GetCrouchReloadAnim(weapon));
} }
if (!attackAssoc) { if (!crouchAnim) {
bIsDucking = false; bIsDucking = false;
#if defined FIX_BUGS || defined FREE_CAM
if (IsPlayer())
bCrouchWhenShooting = false;
#endif
} }
} }
} }

View File

@ -1331,7 +1331,9 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
#ifdef FREE_CAM #ifdef FREE_CAM
static int8 changedHeadingRate = 0; static int8 changedHeadingRate = 0;
static int8 pointedGun = 0;
if (changedHeadingRate == 2) changedHeadingRate = 1; if (changedHeadingRate == 2) changedHeadingRate = 1;
if (pointedGun == 2) pointedGun = 1;
// Rotate player/arm when shooting. We don't have auto-rotation anymore // Rotate player/arm when shooting. We don't have auto-rotation anymore
if (CCamera::m_bUseMouse3rdPerson && CCamera::bFreeCam && if (CCamera::m_bUseMouse3rdPerson && CCamera::bFreeCam &&
@ -1346,10 +1348,10 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
// On this one we can rotate arm. // On this one we can rotate arm.
if (CAN_AIM_WITH_ARM) { if (CAN_AIM_WITH_ARM) {
if (!padUsed->GetWeapon()) { // making this State != ATTACK still stops it after attack. Re-start it immediately! if (!padUsed->GetWeapon()) { // making this State != ATTACK still stops it after attack. Re-start it immediately!
SetWeaponLockOnTarget(nil); SetPointGunAt(nil);
bIsPointingGunAt = false; // to not stop after attack bIsPointingGunAt = false; // to not stop after attack
} }
pointedGun = 2;
SetLookFlag(limitedCam, true); SetLookFlag(limitedCam, true);
SetAimFlag(limitedCam); SetAimFlag(limitedCam);
SetLookTimer(INT32_MAX); // removing this makes head move for real, but I experinced some bugs. SetLookTimer(INT32_MAX); // removing this makes head move for real, but I experinced some bugs.
@ -1373,8 +1375,7 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
m_fRotationCur += (limitedRotDest - m_fRotationCur) / 2; m_fRotationCur += (limitedRotDest - m_fRotationCur) / 2;
} }
} }
} else if (CAN_AIM_WITH_ARM && m_nPedState != PED_ATTACK) }
ClearPointGunAt();
} }
#undef CAN_AIM_WITH_ARM #undef CAN_AIM_WITH_ARM
} }
@ -1382,6 +1383,10 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
changedHeadingRate = 0; changedHeadingRate = 0;
RestoreHeadingRate(); RestoreHeadingRate();
} }
if (pointedGun == 1 && m_nPedState != PED_ATTACK) {
pointedGun = 0;
ClearPointGunAt();
}
#endif #endif
if (padUsed->GetTarget() && m_nSelectedWepSlot == m_currentWeapon && m_nMoveState != PEDMOVE_SPRINT && !TheCamera.Using1stPersonWeaponMode() && weaponInfo->m_bCanAim) { if (padUsed->GetTarget() && m_nSelectedWepSlot == m_currentWeapon && m_nMoveState != PEDMOVE_SPRINT && !TheCamera.Using1stPersonWeaponMode() && weaponInfo->m_bCanAim) {