From 5ec93c4a095f9960f082aeb3adea044505ba8cd8 Mon Sep 17 00:00:00 2001 From: AlexBarys Date: Sun, 23 Apr 2017 18:46:17 -0400 Subject: [PATCH] Implementation to clear entire turret ignore list Implementing the feature request made in issue #1271 to expose the functionality to clear the entire ai turret ignore list to Torquescript. --- Engine/source/T3D/turret/aiTurretShape.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Engine/source/T3D/turret/aiTurretShape.cpp b/Engine/source/T3D/turret/aiTurretShape.cpp index ac36e30ea..492b87bf9 100644 --- a/Engine/source/T3D/turret/aiTurretShape.cpp +++ b/Engine/source/T3D/turret/aiTurretShape.cpp @@ -564,6 +564,11 @@ void AITurretShape::removeFromIgnoreList(ShapeBase* obj) mIgnoreObjects.removeObject(obj); } +void AITurretShape::clearIgnoreList() +{ + mIgnoreObjects.clear(); +} + //---------------------------------------------------------------------------- void AITurretShape::_initState() @@ -1244,6 +1249,13 @@ DefineEngineMethod( AITurretShape, removeFromIgnoreList, void, (ShapeBase* obj), object->removeFromIgnoreList(obj); } +DefineEngineMethod( AITurretShape, clearIgnoreList, void, (),, + "@brief Removes all objects from the turret's ignore list.\n\n" + "All objects in this list will be ignored by the turret's targeting.\n") +{ + object->clearIgnoreList(); +} + DefineEngineMethod( AITurretShape, setTurretState, void, (const char* newState, bool force), (false), "@brief Set the turret's current state.\n\n" "Normally the turret's state comes from updating the state machine but this method "