Browse Source

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.
AlexBarys 8 years ago
parent
commit
5ec93c4a09
1 changed files with 12 additions and 0 deletions
  1. 12 0
      Engine/source/T3D/turret/aiTurretShape.cpp

+ 12 - 0
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 "