mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-05-10 04:27:10 +03:00
Fixed FinishReloading not working properly
This commit is contained in:
parent
96748b3fbc
commit
7e4e06b09d
1 changed files with 12 additions and 9 deletions
|
@ -36,6 +36,7 @@ static int Cover_HideTime(int iTeam)
|
||||||
bool Actor::Cover_IsValid(PathNode *node)
|
bool Actor::Cover_IsValid(PathNode *node)
|
||||||
{
|
{
|
||||||
Vector sight_origin = node->origin + eyeposition;
|
Vector sight_origin = node->origin + eyeposition;
|
||||||
|
|
||||||
if (node->IsClaimedByOther(this)) {
|
if (node->IsClaimedByOther(this)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -129,7 +130,8 @@ void Actor::Cover_FindCover(bool bCheckAll)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_iPotentialCoverCount) {
|
if (!m_iPotentialCoverCount) {
|
||||||
m_iPotentialCoverCount = PathManager.FindPotentialCover(this, origin, m_Enemy, m_pPotentialCoverNode, 16);
|
m_iPotentialCoverCount =
|
||||||
|
PathManager.FindPotentialCover(this, origin, m_Enemy, m_pPotentialCoverNode, MAX_COVER_NODES);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_iPotentialCoverCount) {
|
if (!m_iPotentialCoverCount) {
|
||||||
|
@ -181,7 +183,7 @@ void Actor::Begin_Cover(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TransitionState(ACTOR_STATE_COVER_START, 0);
|
TransitionState(ACTOR_STATE_COVER_NEW_ENEMY, 0);
|
||||||
|
|
||||||
if (level.inttime < m_iEnemyChangeTime + 200) {
|
if (level.inttime < m_iEnemyChangeTime + 200) {
|
||||||
SetLeashHome(origin);
|
SetLeashHome(origin);
|
||||||
|
@ -279,6 +281,11 @@ void Actor::State_Cover_FinishReloading(void)
|
||||||
|
|
||||||
if (pWeapon && eFireType != FT_PROJECTILE && eFireType != FT_SPECIAL_PROJECTILE
|
if (pWeapon && eFireType != FT_PROJECTILE && eFireType != FT_SPECIAL_PROJECTILE
|
||||||
&& (m_csSpecialAttack = m_pCoverNode->GetSpecialAttack(this)) != 0) {
|
&& (m_csSpecialAttack = m_pCoverNode->GetSpecialAttack(this)) != 0) {
|
||||||
|
SetDesiredYaw(m_pCoverNode->angles.yaw());
|
||||||
|
SafeSetOrigin(m_pCoverNode->origin);
|
||||||
|
DesiredAnimation(ANIM_MODE_NORMAL, m_csSpecialAttack);
|
||||||
|
TransitionState(ACTOR_STATE_COVER_SPECIAL_ATTACK, 0);
|
||||||
|
} else {
|
||||||
if (m_pCoverNode->nodeflags & AI_DUCK) {
|
if (m_pCoverNode->nodeflags & AI_DUCK) {
|
||||||
Anim_Crouch();
|
Anim_Crouch();
|
||||||
} else {
|
} else {
|
||||||
|
@ -289,11 +296,6 @@ void Actor::State_Cover_FinishReloading(void)
|
||||||
|
|
||||||
Anim_Aim();
|
Anim_Aim();
|
||||||
AimAtTargetPos();
|
AimAtTargetPos();
|
||||||
} else {
|
|
||||||
SetDesiredYaw(m_pCoverNode->angles.yaw());
|
|
||||||
SafeSetOrigin(m_pCoverNode->origin);
|
|
||||||
DesiredAnimation(ANIM_MODE_NORMAL, m_csSpecialAttack);
|
|
||||||
TransitionState(ACTOR_STATE_COVER_SPECIAL_ATTACK, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,7 +312,7 @@ void Actor::State_Cover_Target(void)
|
||||||
Anim_Aim();
|
Anim_Aim();
|
||||||
AimAtTargetPos();
|
AimAtTargetPos();
|
||||||
|
|
||||||
if (level.inttime < m_iStateTime + 300) {
|
if (level.inttime <= m_iStateTime + 300) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,6 +476,7 @@ void Actor::State_Cover_Shoot(void)
|
||||||
Anim_Shoot();
|
Anim_Shoot();
|
||||||
AimAtTargetPos();
|
AimAtTargetPos();
|
||||||
|
|
||||||
|
// FIXME: debug build only?
|
||||||
if (level.inttime > m_iStateTime + 10000) {
|
if (level.inttime > m_iStateTime + 10000) {
|
||||||
gi.cvar_set("g_monitornum", va("%i", entnum));
|
gi.cvar_set("g_monitornum", va("%i", entnum));
|
||||||
assert(!"anim/shoot.scr took over 10 seconds");
|
assert(!"anim/shoot.scr took over 10 seconds");
|
||||||
|
@ -628,7 +631,7 @@ void Actor::Think_Cover(void)
|
||||||
m_bLockThinkState = false;
|
m_bLockThinkState = false;
|
||||||
if (m_Enemy) {
|
if (m_Enemy) {
|
||||||
if (m_State == ACTOR_STATE_COVER_FAKE_ENEMY) {
|
if (m_State == ACTOR_STATE_COVER_FAKE_ENEMY) {
|
||||||
TransitionState(ACTOR_STATE_COVER_START, 0);
|
TransitionState(ACTOR_STATE_COVER_NEW_ENEMY, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (m_State != ACTOR_STATE_COVER_FAKE_ENEMY) {
|
if (m_State != ACTOR_STATE_COVER_FAKE_ENEMY) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue