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.
This commit is contained in:
AlexBarys 2017-04-23 18:46:17 -04:00 committed by GitHub
parent 974f257f67
commit 5ec93c4a09

View file

@ -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 "