mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Fix issues when using turret while charging a grenade or using the mine detector
This commit is contained in:
commit
4b25e24a13
4 changed files with 14 additions and 11 deletions
|
@ -3498,17 +3498,6 @@ void Player::DoUse(Event *ev)
|
||||||
m_pVehicle->flags &= ~FL_GODMODE;
|
m_pVehicle->flags &= ~FL_GODMODE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bWasInTurretOrVehicle && (m_pVehicle || m_pTurret)) {
|
|
||||||
//
|
|
||||||
// Added in OPM
|
|
||||||
// Reset the legs and torso state.
|
|
||||||
// This prevents players from using a turret and hold the weapon fire
|
|
||||||
// to crouch with their weapon and become impossible to hit
|
|
||||||
currentState_Legs = statemap_Legs->FindState("STAND");
|
|
||||||
currentState_Torso = statemap_Torso->FindState("STAND");
|
|
||||||
charge_start_time = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::TouchStuff(pmove_t *pm)
|
void Player::TouchStuff(pmove_t *pm)
|
||||||
|
@ -5851,6 +5840,7 @@ void Player::NoclipCheat(Event *ev)
|
||||||
|
|
||||||
// reset the state machine so that his animations are correct
|
// reset the state machine so that his animations are correct
|
||||||
ResetState(NULL);
|
ResetState(NULL);
|
||||||
|
charge_start_time = 0;
|
||||||
} else {
|
} else {
|
||||||
client->ps.feetfalling = false;
|
client->ps.feetfalling = false;
|
||||||
movecontrol = MOVECONTROL_LEGS;
|
movecontrol = MOVECONTROL_LEGS;
|
||||||
|
|
|
@ -4624,6 +4624,14 @@ float Weapon::GetSpreadFactor(firemode_t mode)
|
||||||
return fSpreadFactor;
|
return fSpreadFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//======================
|
||||||
|
//Weapon::GetChargeFraction
|
||||||
|
//======================
|
||||||
|
float Weapon::GetChargeFraction(void) const
|
||||||
|
{
|
||||||
|
return charge_fraction;
|
||||||
|
}
|
||||||
|
|
||||||
//======================
|
//======================
|
||||||
//Weapon::GetScriptOwner
|
//Weapon::GetScriptOwner
|
||||||
//======================
|
//======================
|
||||||
|
|
|
@ -454,6 +454,7 @@ public:
|
||||||
Listener *GetScriptOwner(void) override;
|
Listener *GetScriptOwner(void) override;
|
||||||
float GetBulletRange(firemode_t firemode);
|
float GetBulletRange(firemode_t firemode);
|
||||||
float GetSpreadFactor(firemode_t firemode);
|
float GetSpreadFactor(firemode_t firemode);
|
||||||
|
float GetChargeFraction(void) const;
|
||||||
firemode_t GetFireMode(void);
|
firemode_t GetFireMode(void);
|
||||||
qboolean IsSemiAuto(void);
|
qboolean IsSemiAuto(void);
|
||||||
void DoneAnimating(Event *ev);
|
void DoneAnimating(Event *ev);
|
||||||
|
|
|
@ -1500,6 +1500,10 @@ void TurretGun::P_TurretUsed(Player *player)
|
||||||
m_vUserViewAng = player->GetViewAngles();
|
m_vUserViewAng = player->GetViewAngles();
|
||||||
|
|
||||||
if (fabs(AngleSubtract(m_vUserViewAng[1], angles[1])) <= m_fMaxUseAngle) {
|
if (fabs(AngleSubtract(m_vUserViewAng[1], angles[1])) <= m_fMaxUseAngle) {
|
||||||
|
if (player->charge_start_time) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
P_TurretBeginUsed(player);
|
P_TurretBeginUsed(player);
|
||||||
|
|
||||||
flags &= ~FL_THINK;
|
flags &= ~FL_THINK;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue