Skip to content

Commit

Permalink
+ added ai_die_in_anomaly via space_restrictor.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
revolucas authored and Xottab-DUTY committed Dec 23, 2017
1 parent 15edbfd commit e95b567
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/xrGame/console_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ int g_keypress_on_start = 1;

ENGINE_API extern float g_console_sensitive;

extern BOOL g_ai_die_in_anomaly; //Alundaio

void register_mp_console_commands();
//-----------------------------------------------------------

Expand Down Expand Up @@ -2149,6 +2151,8 @@ void CCC_RegisterCommands()

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

CMD4(CCC_Integer, "ai_die_in_anomaly", &g_ai_die_in_anomaly, 0, 1); //Alundaio

CMD4(CCC_Float, "ai_aim_predict_time", &g_aim_predict_time, 0.f, 10.f);

#ifdef DEBUG
Expand Down
9 changes: 8 additions & 1 deletion src/xrGame/space_restrictor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
#include "debug_renderer.h"
#endif

//Alundaio
#include "RadioactiveZone.h"
BOOL g_ai_die_in_anomaly = 0;
//-Alundaio

CSpaceRestrictor::~CSpaceRestrictor() {}
void CSpaceRestrictor::Center(Fvector& C) const { XFORM().transform_tiny(C, GetCForm()->getSphere().P); }
float CSpaceRestrictor::Radius() const { return (GetCForm()->getRadius()); }
Expand Down Expand Up @@ -60,7 +65,9 @@ BOOL CSpaceRestrictor::net_Spawn(CSE_Abstract* data)
if (!result)
return (FALSE);

spatial.type &= ~STYPE_VISIBLEFORAI;
CCustomZone* zone = smart_cast<CCustomZone*>(this);
if (g_ai_die_in_anomaly == 0 || !zone || smart_cast<CRadioactiveZone*>(zone))
spatial.type &= ~STYPE_VISIBLEFORAI;

setEnabled(FALSE);
setVisible(FALSE);
Expand Down

0 comments on commit e95b567

Please sign in to comment.