Skip to content

Commit

Permalink
* changed cycle down in WeaponMagazined.cpp
Browse files Browse the repository at this point in the history
* increased the Y distance for the floor/ceiling wall look prevention
  • Loading branch information
revolucas authored and Xottab-DUTY committed Dec 12, 2017
1 parent 6f704f1 commit 5aebfda
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
19 changes: 5 additions & 14 deletions src/xrGame/WeaponMagazined.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void CWeaponMagazined::Load(LPCSTR section)

m_sSndShotCurrent = "sndShot";

//звуки и партиклы глушителя, еслит такой есть
//звуки и партиклы глушителя, если такой есть
if (m_eSilencerStatus == ALife::eAddonAttachable || m_eSilencerStatus == ALife::eAddonPermanent)
{
if (pSettings->line_exist(section, "silencer_flame_particles"))
Expand Down Expand Up @@ -532,12 +532,6 @@ void CWeaponMagazined::state_Fire(float dt)

VERIFY(!m_magazine.empty());

//Alundaio: Use fModeShotTime instead of fOneShotTime if current fire mode is 2-shot burst
float rpm = fOneShotTime;
if (GetCurrentFireMode() == 2)
rpm = modeShotTime;
//Alundaio: END

while (!m_magazine.empty() && fShotTimeCounter < 0 && (IsWorking() || m_bFireSingleShot) &&
(m_iQueueSize < 0 || m_iShotNum < m_iQueueSize))
{
Expand All @@ -549,14 +543,11 @@ void CWeaponMagazined::state_Fire(float dt)

m_bFireSingleShot = false;

//Alundaio: Use fModeShotTime instead of fOneShotTime if current fire mode is 2-shot burst
//Alundaio: Cycle down RPM after two shots; used for Abakan/AN-94
if (cycleDown == true)
{
if (m_iShotNum <= 2)
rpm = modeShotTime;
else
rpm = fOneShotTime;
}
float rpm = fOneShotTime;
if (GetCurrentFireMode() == 2 || (cycleDown == true && m_iShotNum <= 1))
rpm = modeShotTime;

fShotTimeCounter += rpm;
//Alundaio: END
Expand Down
8 changes: 4 additions & 4 deletions src/xrGame/stalker_combat_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ void CStalkerActionTakeCover::execute()
}
else
{
if (_abs(object().Position().y - mem_object.m_object_params.m_position.y) > 3.f)
if (_abs(object().Position().y - mem_object.m_object_params.m_position.y) > 3.5f)
{
Fvector3 Vpos = { mem_object.m_object_params.m_position.x, object().Position().y + 1.f, mem_object.m_object_params.m_position.z };
object().sight().setup(CSightAction(SightManager::eSightTypePosition, Vpos, true));
Expand Down Expand Up @@ -644,7 +644,7 @@ void CStalkerActionLookOut::execute()
return;

//Alundaio: Prevent stalkers from staring at floor or ceiling for this action
if (_abs(object().Position().y - mem_object.m_object_params.m_position.y) > 3.f)
if (_abs(object().Position().y - mem_object.m_object_params.m_position.y) > 3.5f)
{
Fvector3 Vpos = { mem_object.m_object_params.m_position.x, object().Position().y + 1.f, mem_object.m_object_params.m_position.z };
object().sight().setup(CSightAction(SightManager::eSightTypePosition, Vpos, true));
Expand Down Expand Up @@ -745,7 +745,7 @@ void CStalkerActionHoldPosition::execute()
m_storage->set_property(eWorldPropertyLookedOut, false);

//Alundaio: Prevent stalkers from staring at floor or ceiling for this action
if (_abs(object().Position().y - mem_object.m_object_params.m_position.y) > 3.f)
if (_abs(object().Position().y - mem_object.m_object_params.m_position.y) > 3.5f)
{
Fvector3 Vpos = { mem_object.m_object_params.m_position.x, object().Position().y + 1.f, mem_object.m_object_params.m_position.z };
object().sight().setup(CSightAction(SightManager::eSightTypePosition, Vpos, true));
Expand Down Expand Up @@ -870,7 +870,7 @@ void CStalkerActionDetourEnemy::execute()
}

//Alundaio: Prevent stalkers from staring at floor or ceiling for this action
if (_abs(object().Position().y - mem_object.m_object_params.m_position.y) > 3.f)
if (_abs(object().Position().y - mem_object.m_object_params.m_position.y) > 3.5f)
{
Fvector3 Vpos = { mem_object.m_object_params.m_position.x, object().Position().y + 1.f, mem_object.m_object_params.m_position.z };
object().sight().setup(CSightAction(SightManager::eSightTypePosition, Vpos, true));
Expand Down
5 changes: 5 additions & 0 deletions src/xrGame/stalker_danger_in_direction_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ void CStalkerActionDangerInDirectionHoldPosition::execute()
// if (!mem_object.m_object)
// return;

//Alundaio:
if (!object().memory().danger().selected())
return;
//-Alundaio

Fvector position = object().memory().danger().selected()->position();

if (current_cover(m_object) < 3.f)
Expand Down

0 comments on commit 5aebfda

Please sign in to comment.