Skip to content

Commit 236a01b

Browse files
committed
Чтобы CAnomalyDetector не пытался обрабатывать отключенные аномалии
1 parent f084ff8 commit 236a01b

File tree

4 files changed

+10
-24
lines changed

4 files changed

+10
-24
lines changed

ogsr_engine/COMMON_AI/xrMessages.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ enum
6868

6969
GE_GRENADE_EXPLODE,
7070

71-
GE_ZONE_STATE_CHANGE,
72-
7371
GE_CHANGE_POS,
7472

7573
GE_CHANGE_VISUAL,

ogsr_engine/xrGame/CustomZone.cpp

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,12 +1194,6 @@ void CCustomZone::OnEvent(NET_Packet& P, u16 type)
11941194
{
11951195
switch (type)
11961196
{
1197-
case GE_ZONE_STATE_CHANGE: {
1198-
u8 S;
1199-
P.r_u8(S);
1200-
OnStateSwitch(EZoneState(S));
1201-
break;
1202-
}
12031197
case GE_OWNERSHIP_TAKE: {
12041198
u16 id;
12051199
P.r_u16(id);
@@ -1265,13 +1259,7 @@ void CCustomZone::OnStateSwitch(EZoneState new_state)
12651259

12661260
void CCustomZone::SwitchZoneState(EZoneState new_state)
12671261
{
1268-
{
1269-
// !!! Just single entry for given state !!!
1270-
NET_Packet P;
1271-
u_EventGen(P, GE_ZONE_STATE_CHANGE, ID());
1272-
P.w_u8(u8(new_state));
1273-
u_EventSend(P);
1274-
};
1262+
OnStateSwitch(new_state);
12751263

12761264
m_iPreviousStateTime = m_iStateTime = 0;
12771265
}
@@ -1603,10 +1591,7 @@ void CCustomZone::UpdateOnOffState()
16031591
void CCustomZone::GoDisabledState()
16041592
{
16051593
// switch to disable
1606-
NET_Packet P;
1607-
u_EventGen(P, GE_ZONE_STATE_CHANGE, ID());
1608-
P.w_u8(u8(eZoneStateDisabled));
1609-
u_EventSend(P);
1594+
OnStateSwitch(eZoneStateDisabled);
16101595

16111596
OBJECT_INFO_VEC_IT it = m_ObjectInfoMap.begin();
16121597
OBJECT_INFO_VEC_IT it_e = m_ObjectInfoMap.end();
@@ -1621,10 +1606,7 @@ void CCustomZone::GoDisabledState()
16211606
void CCustomZone::GoEnabledState()
16221607
{
16231608
// switch to idle
1624-
NET_Packet P;
1625-
u_EventGen(P, GE_ZONE_STATE_CHANGE, ID());
1626-
P.w_u8(u8(eZoneStateIdle));
1627-
u_EventSend(P);
1609+
OnStateSwitch(eZoneStateIdle);
16281610
}
16291611

16301612
BOOL CCustomZone::feel_touch_on_contact(CObject* O)

ogsr_engine/xrGame/ai/monsters/anomaly_detector.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,16 @@ BOOL CAnomalyDetector::feel_touch_contact(CObject* obj)
9797

9898
void CAnomalyDetector::on_contact(CObject* obj)
9999
{
100+
if (obj->getDestroy())
101+
return;
102+
100103
auto custom_zone = smart_cast<CCustomZone*>(obj);
104+
101105
ASSERT_FMT(custom_zone, "[%s]: %s not a CCUstomZone", __FUNCTION__, obj->cName().c_str());
102106

107+
if (custom_zone->ZoneState() == CCustomZone::eZoneStateDisabled)
108+
return;
109+
103110
auto it = std::find_if(m_storage.begin(), m_storage.end(), [custom_zone](const auto& it) { return it.id == custom_zone->ID(); });
104111
if (it != m_storage.end())
105112
{

ogsr_engine/xrGame/xrServer_process_event.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ void xrServer::Process_event(NET_Packet& P, ClientID sender)
4646
{
4747
case GE_INFO_TRANSFER:
4848
case GE_WPN_STATE_CHANGE:
49-
case GE_ZONE_STATE_CHANGE:
5049
case GEG_PLAYER_ATTACH_HOLDER:
5150
case GEG_PLAYER_DETACH_HOLDER:
5251
case GEG_PLAYER_ACTIVATEARTEFACT:

0 commit comments

Comments
 (0)