From 5ec93c4a095f9960f082aeb3adea044505ba8cd8 Mon Sep 17 00:00:00 2001 From: AlexBarys Date: Sun, 23 Apr 2017 18:46:17 -0400 Subject: [PATCH 1/2] 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 " From ff034d5cff362aae433871ddb7c56daaa6e5e00f Mon Sep 17 00:00:00 2001 From: AlexBarys Date: Sun, 23 Apr 2017 18:49:26 -0400 Subject: [PATCH 2/2] Added clearIgnoreList() definition Added the definition for the new function created to implement the feature request in issue #1271 to clear the entire ai turret ignore list with one function call. --- Engine/source/T3D/turret/aiTurretShape.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/source/T3D/turret/aiTurretShape.h b/Engine/source/T3D/turret/aiTurretShape.h index 18c0fb728..f7b965d5b 100644 --- a/Engine/source/T3D/turret/aiTurretShape.h +++ b/Engine/source/T3D/turret/aiTurretShape.h @@ -257,6 +257,7 @@ public: void addToIgnoreList(ShapeBase* obj); void removeFromIgnoreList(ShapeBase* obj); + void clearIgnoreList(); void setTurretStateName(const char* newState, bool force=false); void setTurretState(U32 newState, bool force=false);