feat(Core/SmartScripts): Add a warning when a boolean value is outside of [0,1] range (#10038)

This commit is contained in:
IntelligentQuantum
2022-01-10 20:33:00 +03:30
committed by GitHub
parent 3cbe23865f
commit e482cce164
4 changed files with 199 additions and 70 deletions

View File

@@ -133,7 +133,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (Unit* tempInvoker = GetLastInvoker())
LOG_DEBUG("sql.sql", "SmartScript::ProcessAction: Invoker: %s (%s)", tempInvoker->GetName().c_str(), tempInvoker->GetGUID().ToString().c_str());
bool isControlled = e.action.MoveToPos.controlled > 0;
bool isControlled = e.action.moveToPos.controlled > 0;
switch (e.GetActionType())
{
@@ -1880,7 +1880,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
Position srcPos = { e.target.x, e.target.y, e.target.z, e.target.o };
Position randomPoint = me->GetRandomPoint(srcPos, range);
me->GetMotionMaster()->MovePoint(
e.action.MoveToPos.pointId,
e.action.moveToPos.pointId,
randomPoint.m_positionX,
randomPoint.m_positionY,
randomPoint.m_positionZ,
@@ -1912,20 +1912,20 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (!target)
{
G3D::Vector3 dest(e.target.x, e.target.y, e.target.z);
if (e.action.MoveToPos.transport)
if (e.action.moveToPos.transport)
if (TransportBase* trans = me->GetDirectTransport())
trans->CalculatePassengerPosition(dest.x, dest.y, dest.z);
me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, dest.x, dest.y, dest.z, true, true,
me->GetMotionMaster()->MovePoint(e.action.moveToPos.pointId, dest.x, dest.y, dest.z, true, true,
isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE, e.target.o);
}
else // Xinef: we can use dest.x, dest.y, dest.z to make offset
{
float x, y, z;
target->GetPosition(x, y, z);
if (e.action.MoveToPos.ContactDistance > 0)
target->GetContactPoint(me, x, y, z, e.action.MoveToPos.ContactDistance);
me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, x + e.target.x, y + e.target.y, z + e.target.z, true, true, isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
if (e.action.moveToPos.ContactDistance > 0)
target->GetContactPoint(me, x, y, z, e.action.moveToPos.ContactDistance);
me->GetMotionMaster()->MovePoint(e.action.moveToPos.pointId, x + e.target.x, y + e.target.y, z + e.target.z, true, true, isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
}
break;
}
@@ -1940,7 +1940,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (IsCreature(*itr))
{
Creature* target = (*itr)->ToCreature();
target->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, e.target.x, e.target.y, e.target.z, true, true, isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
target->GetMotionMaster()->MovePoint(e.action.moveToPos.pointId, e.target.x, e.target.y, e.target.z, true, true, isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
}
}

View File

@@ -28,6 +28,16 @@
#include "ScriptedCreature.h"
#include "SpellMgr.h"
#define AC_SAI_IS_BOOLEAN_VALID(e, value) \
{ \
if (value > 1) \
{ \
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses param %s of type Boolean with value %u, valid values are 0 or 1, skipped.", \
e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), STRINGIZE(value), value); \
return false; \
} \
}
SmartWaypointMgr* SmartWaypointMgr::instance()
{
static SmartWaypointMgr instance;
@@ -338,31 +348,44 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
}
break;
}
case SMART_TARGET_PLAYER_RANGE:
case SMART_TARGET_SELF:
case SMART_TARGET_VICTIM:
case SMART_TARGET_HOSTILE_SECOND_AGGRO:
case SMART_TARGET_HOSTILE_LAST_AGGRO:
case SMART_TARGET_HOSTILE_RANDOM:
case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP:
case SMART_TARGET_ACTION_INVOKER:
case SMART_TARGET_INVOKER_PARTY:
case SMART_TARGET_POSITION:
case SMART_TARGET_NONE:
case SMART_TARGET_ACTION_INVOKER_VEHICLE:
case SMART_TARGET_OWNER_OR_SUMMONER:
case SMART_TARGET_THREAT_LIST:
AC_SAI_IS_BOOLEAN_VALID(e, e.target.hostilRandom.playerOnly);
break;
case SMART_TARGET_FARTHEST:
AC_SAI_IS_BOOLEAN_VALID(e, e.target.farthest.playerOnly);
AC_SAI_IS_BOOLEAN_VALID(e, e.target.farthest.isInLos);
break;
case SMART_TARGET_CLOSEST_GAMEOBJECT:
case SMART_TARGET_CLOSEST_CREATURE:
AC_SAI_IS_BOOLEAN_VALID(e, e.target.closest.dead);
break;
case SMART_TARGET_CLOSEST_ENEMY:
AC_SAI_IS_BOOLEAN_VALID(e, e.target.closestAttackable.playerOnly);
break;
case SMART_TARGET_CLOSEST_FRIENDLY:
AC_SAI_IS_BOOLEAN_VALID(e, e.target.closestFriendly.playerOnly);
break;
case SMART_TARGET_OWNER_OR_SUMMONER:
AC_SAI_IS_BOOLEAN_VALID(e, e.target.owner.useCharmerOrOwner);
break;
case SMART_TARGET_ACTION_INVOKER:
case SMART_TARGET_INVOKER_PARTY:
case SMART_TARGET_ACTION_INVOKER_VEHICLE:
case SMART_TARGET_STORED:
case SMART_TARGET_FARTHEST:
case SMART_TARGET_PLAYER_WITH_AURA:
case SMART_TARGET_RANDOM_POINT:
case SMART_TARGET_ROLE_SELECTION:
case SMART_TARGET_LOOT_RECIPIENTS:
case SMART_EVENT_SUMMONED_UNIT_DIES:
case SMART_TARGET_PLAYER_RANGE:
case SMART_TARGET_SELF:
case SMART_TARGET_VICTIM:
case SMART_TARGET_POSITION:
case SMART_TARGET_NONE:
case SMART_TARGET_THREAT_LIST:
break;
default:
LOG_ERROR("sql.sql", "SmartAIMgr: Not handled target_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetTargetType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
@@ -500,6 +523,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.los.hostilityMode, AsUnderlyingType(SmartEvent::LOSHostilityMode::End) - 1);
return false;
}
AC_SAI_IS_BOOLEAN_VALID(e, e.event.los.playerOnly);
break;
case SMART_EVENT_RESPAWN:
if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_MAP && !sMapStore.LookupEntry(e.event.respawn.map))
@@ -542,6 +567,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
if (e.event.kill.creature && !IsCreatureValid(e, e.event.kill.creature))
return false;
AC_SAI_IS_BOOLEAN_VALID(e, e.event.kill.playerOnly);
break;
case SMART_EVENT_VICTIM_CASTING:
if (e.event.targetCasting.spellId > 0 && !sSpellMgr->GetSpellInfo(e.event.targetCasting.spellId))
@@ -742,6 +769,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false;
}
break;
case SMART_EVENT_CHARMED:
case SMART_EVENT_GO_STATE_CHANGED:
case SMART_EVENT_GO_EVENT_INFORM:
case SMART_EVENT_NEAR_PLAYERS:
@@ -749,7 +777,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_EVENT_TIMED_EVENT_TRIGGERED:
case SMART_EVENT_INSTANCE_PLAYER_ENTER:
case SMART_EVENT_TRANSPORT_RELOCATE:
case SMART_EVENT_CHARMED:
case SMART_EVENT_CHARMED_TARGET:
case SMART_EVENT_CORPSE_REMOVED:
case SMART_EVENT_AI_INIT:
@@ -821,6 +848,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SOUND:
if (!IsSoundValid(e, e.action.sound.sound))
return false;
AC_SAI_IS_BOOLEAN_VALID(e, e.action.sound.onlySelf);
break;
case SMART_ACTION_RANDOM_SOUND:
if (e.action.randomSound.sound1 && !IsSoundValid(e, e.action.randomSound.sound1))
@@ -857,9 +885,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
if (!IsEmoteValid(e, e.action.emote.emote))
return false;
break;
case SMART_ACTION_FAIL_QUEST:
case SMART_ACTION_OFFER_QUEST:
if (!e.action.quest.quest || !IsQuestValid(e, e.action.quest.quest))
if (!IsQuestValid(e, e.action.questOffer.questID))
return false;
AC_SAI_IS_BOOLEAN_VALID(e, e.action.questOffer.directAdd);
break;
case SMART_ACTION_FAIL_QUEST:
if (!IsQuestValid(e, e.action.quest.quest))
return false;
break;
case SMART_ACTION_ACTIVATE_TAXI:
@@ -987,6 +1020,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect TempSummonType %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonCreature.type);
return false;
}
AC_SAI_IS_BOOLEAN_VALID(e, e.action.summonCreature.attackInvoker);
break;
case SMART_ACTION_CALL_KILLEDMONSTER:
if (!IsCreatureValid(e, e.action.killedMonster.creature))
@@ -995,6 +1030,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_UPDATE_TEMPLATE:
if (!IsCreatureValid(e, e.action.updateTemplate.creature))
return false;
AC_SAI_IS_BOOLEAN_VALID(e, e.action.updateTemplate.updateLevel);
break;
case SMART_ACTION_SET_SHEATH:
if (e.action.setSheath.sheath && e.action.setSheath.sheath >= MAX_SHEATH_STATE)
@@ -1041,6 +1077,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_WP_STOP:
if (e.action.wpStop.quest && !IsQuestValid(e, e.action.wpStop.quest))
return false;
AC_SAI_IS_BOOLEAN_VALID(e, e.action.wpStop.fail);
break;
case SMART_ACTION_WP_START:
{
@@ -1061,6 +1098,9 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
LOG_ERROR("sql.sql", "SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.reactState);
return false;
}
AC_SAI_IS_BOOLEAN_VALID(e, e.action.wpStart.run);
AC_SAI_IS_BOOLEAN_VALID(e, e.action.wpStart.repeat);
break;
}
case SMART_ACTION_CREATE_TIMED_EVENT:
@@ -1203,15 +1243,78 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
break;
}
case SMART_ACTION_AUTO_ATTACK:
{
AC_SAI_IS_BOOLEAN_VALID(e, e.action.autoAttack.attack);
break;
}
case SMART_ACTION_ALLOW_COMBAT_MOVEMENT:
{
AC_SAI_IS_BOOLEAN_VALID(e, e.action.combatMove.move);
break;
}
case SMART_ACTION_CALL_FOR_HELP:
{
AC_SAI_IS_BOOLEAN_VALID(e, e.action.callHelp.withEmote);
break;
}
case SMART_ACTION_SET_VISIBILITY:
{
AC_SAI_IS_BOOLEAN_VALID(e, e.action.visibility.state);
break;
}
case SMART_ACTION_SET_RUN:
{
AC_SAI_IS_BOOLEAN_VALID(e, e.action.setRun.run);
break;
}
case SMART_ACTION_SET_CAN_FLY:
{
AC_SAI_IS_BOOLEAN_VALID(e, e.action.setFly.fly);
break;
}
case SMART_ACTION_SET_SWIM:
{
AC_SAI_IS_BOOLEAN_VALID(e, e.action.setSwim.swim);
break;
}
case SMART_ACTION_SET_COUNTER:
{
AC_SAI_IS_BOOLEAN_VALID(e, e.action.setCounter.reset);
break;
}
case SMART_ACTION_INTERRUPT_SPELL:
{
AC_SAI_IS_BOOLEAN_VALID(e, e.action.interruptSpellCasting.withDelayed);
AC_SAI_IS_BOOLEAN_VALID(e, e.action.interruptSpellCasting.withInstant);
break;
}
case SMART_ACTION_SET_ROOT:
{
AC_SAI_IS_BOOLEAN_VALID(e, e.action.setRoot.root);
break;
}
case SMART_ACTION_DISABLE_EVADE:
{
AC_SAI_IS_BOOLEAN_VALID(e, e.action.disableEvade.disable);
break;
}
case SMART_ACTION_LOAD_EQUIPMENT:
{
AC_SAI_IS_BOOLEAN_VALID(e, e.action.loadEquipment.force);
break;
}
case SMART_ACTION_FLEE_FOR_ASSIST:
case SMART_ACTION_MOVE_TO_POS:
case SMART_ACTION_CALL_TIMED_ACTIONLIST:
case SMART_ACTION_EVADE:
case SMART_ACTION_SET_ACTIVE:
case SMART_ACTION_START_CLOSEST_WAYPOINT:
case SMART_ACTION_FOLLOW:
case SMART_ACTION_SET_ORIENTATION:
case SMART_ACTION_STORE_TARGET_LIST:
case SMART_ACTION_EVADE:
case SMART_ACTION_FLEE_FOR_ASSIST:
case SMART_ACTION_COMBAT_STOP:
case SMART_ACTION_DIE:
case SMART_ACTION_SET_ACTIVE:
case SMART_ACTION_WP_RESUME:
case SMART_ACTION_KILL_UNIT:
case SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL:
@@ -1220,22 +1323,15 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_THREAT_ALL_PCT:
case SMART_ACTION_THREAT_SINGLE_PCT:
case SMART_ACTION_SET_INST_DATA64:
case SMART_ACTION_AUTO_ATTACK:
case SMART_ACTION_ALLOW_COMBAT_MOVEMENT:
case SMART_ACTION_CALL_FOR_HELP:
case SMART_ACTION_SET_DATA:
case SMART_ACTION_MOVE_FORWARD:
case SMART_ACTION_SET_VISIBILITY:
case SMART_ACTION_WP_PAUSE:
case SMART_ACTION_SET_FLY:
case SMART_ACTION_SET_RUN:
case SMART_ACTION_SET_SWIM:
case SMART_ACTION_FORCE_DESPAWN:
case SMART_ACTION_SET_INGAME_PHASE_MASK:
case SMART_ACTION_SET_UNIT_FLAG:
case SMART_ACTION_REMOVE_UNIT_FLAG:
case SMART_ACTION_PLAYMOVIE:
case SMART_ACTION_MOVE_TO_POS:
case SMART_ACTION_RESPAWN_TARGET:
case SMART_ACTION_CLOSE_GOSSIP:
case SMART_ACTION_TRIGGER_TIMED_EVENT:
@@ -1245,17 +1341,17 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_ACTIVATE_GOBJECT:
case SMART_ACTION_CALL_SCRIPT_RESET:
case SMART_ACTION_SET_RANGED_MOVEMENT:
case SMART_ACTION_CALL_TIMED_ACTIONLIST:
case SMART_ACTION_SET_NPC_FLAG:
case SMART_ACTION_ADD_NPC_FLAG:
case SMART_ACTION_REMOVE_NPC_FLAG:
case SMART_ACTION_TALK:
AC_SAI_IS_BOOLEAN_VALID(e, e.action.talk.useTalkTarget);
[[fallthrough]];
case SMART_ACTION_SIMPLE_TALK:
case SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST:
case SMART_ACTION_RANDOM_MOVE:
case SMART_ACTION_SET_UNIT_FIELD_BYTES_1:
case SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1:
case SMART_ACTION_INTERRUPT_SPELL:
case SMART_ACTION_SEND_GO_CUSTOM_ANIM:
case SMART_ACTION_SET_DYNAMIC_FLAG:
case SMART_ACTION_ADD_DYNAMIC_FLAG:
@@ -1267,7 +1363,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SEND_TARGET_TO_TARGET:
case SMART_ACTION_SET_HOME_POS:
case SMART_ACTION_SET_HEALTH_REGEN:
case SMART_ACTION_SET_ROOT:
case SMART_ACTION_SET_GO_FLAG:
case SMART_ACTION_ADD_GO_FLAG:
case SMART_ACTION_REMOVE_GO_FLAG:
@@ -1282,12 +1377,10 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SET_SIGHT_DIST:
case SMART_ACTION_FLEE:
case SMART_ACTION_ADD_THREAT:
case SMART_ACTION_LOAD_EQUIPMENT:
case SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT:
case SMART_ACTION_SET_HOVER:
case SMART_ACTION_ADD_IMMUNITY:
case SMART_ACTION_REMOVE_IMMUNITY:
case SMART_ACTION_SET_COUNTER:
case SMART_ACTION_FALL:
case SMART_ACTION_SET_EVENT_FLAG_RESET:
case SMART_ACTION_REMOVE_ALL_GAMEOBJECTS:

View File

@@ -26,6 +26,8 @@
#include "SpellMgr.h"
#include "Unit.h"
typedef uint32 SAIBool;
struct WayPoint
{
WayPoint(uint32 _id, float _x, float _y, float _z, float _o, uint32 _delay)
@@ -214,7 +216,7 @@ struct SmartEvent
{
uint32 cooldownMin;
uint32 cooldownMax;
uint32 playerOnly;
SAIBool playerOnly;
uint32 creature;
} kill;
@@ -235,7 +237,7 @@ struct SmartEvent
uint32 maxDist;
uint32 cooldownMin;
uint32 cooldownMax;
uint32 playerOnly;
SAIBool playerOnly;
} los;
struct
@@ -665,7 +667,7 @@ struct SmartAction
{
uint32 textGroupID;
uint32 duration;
uint32 useTalkTarget;
SAIBool useTalkTarget;
} talk;
struct
@@ -682,7 +684,7 @@ struct SmartAction
struct
{
uint32 sound;
uint32 onlySelf;
SAIBool onlySelf;
} sound;
struct
@@ -691,7 +693,7 @@ struct SmartAction
uint32 sound2;
uint32 sound3;
uint32 sound4;
uint32 onlySelf;
SAIBool onlySelf;
} randomSound;
struct
@@ -724,7 +726,7 @@ struct SmartAction
struct
{
uint32 questID;
uint32 directAdd;
SAIBool directAdd;
} questOffer;
struct
@@ -774,7 +776,7 @@ struct SmartAction
uint32 creature;
uint32 type;
uint32 duration;
uint32 attackInvoker;
SAIBool attackInvoker;
uint32 attackScriptOwner;
} summonCreature;
@@ -806,12 +808,12 @@ struct SmartAction
struct
{
uint32 attack;
SAIBool attack;
} autoAttack;
struct
{
uint32 move;
SAIBool move;
} combatMove;
struct
@@ -877,13 +879,13 @@ struct SmartAction
struct
{
uint32 creature;
uint32 updateLevel;
SAIBool updateLevel;
} updateTemplate;
struct
{
uint32 range;
uint32 withEmote;
SAIBool withEmote;
} callHelp;
struct
@@ -921,7 +923,7 @@ struct SmartAction
struct
{
uint32 state;
SAIBool state;
} visibility;
struct
@@ -943,9 +945,9 @@ struct SmartAction
struct
{
uint32 run;
SAIBool run;
uint32 pathID;
uint32 repeat;
SAIBool repeat;
uint32 quest;
uint32 despawnTime;
uint32 reactState;
@@ -960,7 +962,7 @@ struct SmartAction
{
uint32 despawnTime;
uint32 quest;
uint32 fail;
SAIBool fail;
} wpStop;
struct
@@ -981,19 +983,19 @@ struct SmartAction
struct
{
uint32 run;
SAIBool run;
} setRun;
struct
{
uint32 fly;
SAIBool fly;
uint32 speed;
uint32 disableGravity;
} setFly;
struct
{
uint32 swim;
SAIBool swim;
} setSwim;
struct
@@ -1005,7 +1007,7 @@ struct SmartAction
{
uint32 counterId;
uint32 value;
uint32 reset;
SAIBool reset;
uint32 subtract;
} setCounter;
@@ -1079,9 +1081,9 @@ struct SmartAction
struct
{
uint32 withDelayed;
SAIBool withDelayed;
uint32 spell_id;
uint32 withInstant;
SAIBool withInstant;
} interruptSpellCasting;
struct
@@ -1114,10 +1116,10 @@ struct SmartAction
struct
{
uint32 pointId;
uint32 transport;
SAIBool transport;
uint32 controlled;
uint32 ContactDistance;
} MoveToPos;
} moveToPos;
struct
{
@@ -1148,7 +1150,7 @@ struct SmartAction
struct
{
uint32 root;
SAIBool root;
} setRoot;
struct
@@ -1218,7 +1220,7 @@ struct SmartAction
struct
{
uint32 id;
uint32 force;
SAIBool force;
} loadEquipment;
struct
@@ -1295,7 +1297,7 @@ struct SmartAction
struct
{
uint32 disable;
SAIBool disable;
} disableEvade;
struct
@@ -1408,15 +1410,15 @@ struct SmartTarget
struct
{
uint32 maxDist;
uint32 playerOnly;
SAIBool playerOnly;
uint32 powerType;
} hostilRandom;
struct
{
uint32 maxDist;
uint32 playerOnly;
uint32 isInLos;
SAIBool playerOnly;
SAIBool isInLos;
} farthest;
struct
@@ -1490,14 +1492,14 @@ struct SmartTarget
struct
{
uint32 useCharmerOrOwner;
SAIBool useCharmerOrOwner;
} owner;
struct
{
uint32 entry;
uint32 dist;
uint32 dead;
SAIBool dead;
} closest;
struct
@@ -1510,13 +1512,13 @@ struct SmartTarget
struct
{
uint32 maxDist;
uint32 playerOnly;
SAIBool playerOnly;
} closestAttackable;
struct
{
uint32 maxDist;
uint32 playerOnly;
SAIBool playerOnly;
} closestFriendly;
struct