Skip to content

Commit e95b567

Browse files
revolucasXottab-DUTY
authored andcommitted
+ added ai_die_in_anomaly via space_restrictor.cpp
1 parent 15edbfd commit e95b567

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/xrGame/console_commands.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ int g_keypress_on_start = 1;
101101

102102
ENGINE_API extern float g_console_sensitive;
103103

104+
extern BOOL g_ai_die_in_anomaly; //Alundaio
105+
104106
void register_mp_console_commands();
105107
//-----------------------------------------------------------
106108

@@ -2149,6 +2151,8 @@ void CCC_RegisterCommands()
21492151

21502152
CMD4(CCC_Integer, "ai_use_old_vision", &g_ai_use_old_vision, 0, 1);
21512153

2154+
CMD4(CCC_Integer, "ai_die_in_anomaly", &g_ai_die_in_anomaly, 0, 1); //Alundaio
2155+
21522156
CMD4(CCC_Float, "ai_aim_predict_time", &g_aim_predict_time, 0.f, 10.f);
21532157

21542158
#ifdef DEBUG

src/xrGame/space_restrictor.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
#include "debug_renderer.h"
2020
#endif
2121

22+
//Alundaio
23+
#include "RadioactiveZone.h"
24+
BOOL g_ai_die_in_anomaly = 0;
25+
//-Alundaio
26+
2227
CSpaceRestrictor::~CSpaceRestrictor() {}
2328
void CSpaceRestrictor::Center(Fvector& C) const { XFORM().transform_tiny(C, GetCForm()->getSphere().P); }
2429
float CSpaceRestrictor::Radius() const { return (GetCForm()->getRadius()); }
@@ -60,7 +65,9 @@ BOOL CSpaceRestrictor::net_Spawn(CSE_Abstract* data)
6065
if (!result)
6166
return (FALSE);
6267

63-
spatial.type &= ~STYPE_VISIBLEFORAI;
68+
CCustomZone* zone = smart_cast<CCustomZone*>(this);
69+
if (g_ai_die_in_anomaly == 0 || !zone || smart_cast<CRadioactiveZone*>(zone))
70+
spatial.type &= ~STYPE_VISIBLEFORAI;
6471

6572
setEnabled(FALSE);
6673
setVisible(FALSE);

0 commit comments

Comments
 (0)