Skip to content

Commit

Permalink
Fixed some not working smart covers in CS (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Oct 6, 2019
1 parent c376098 commit 52ce001
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/xrGame/stalker_movement_manager_smart_cover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,7 @@ void stalker_movement_manager_smart_cover::reach_enter_location(u32 const& time_
if (!object().sight().current_action().target_reached())
return;

// morrey
// смарткаверы чн-ные не работали. заюзал из чн алгоритм
//if (target_params().cover()->can_fire()) // ЗП
//if (target_params().cover()->is_combat_cover()) // ЧН
if (target_params().cover()->can_fire() || target_params().cover()->is_combat_cover()) // Xottab_DUTY to morrey: а если так попробовать?
if (target_params().cover()->can_fire())
{
CInventoryItem const* const inventory_item = object().inventory().ActiveItem();
if (!inventory_item)
Expand Down
7 changes: 7 additions & 0 deletions src/xrServerEntities/xrServer_Objects_Alife_Smartcovers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ void CSE_SmartCover::STATE_Read(NET_Packet& tNetPacket, u16 size)

if (m_wVersion >= 128)
m_can_fire = tNetPacket.r_u8();
else
{
// I don't know how, but it seems that
// m_is_combat_cover can be changed
// in scripts. Let's just sync here.
m_can_fire = m_is_combat_cover;
}
}

void CSE_SmartCover::STATE_Write(NET_Packet& tNetPacket)
Expand Down

0 comments on commit 52ce001

Please sign in to comment.