Add Actor.OnDamaged
Allows the AI to react to its units being attacked.
This commit is contained in:
@@ -143,6 +143,10 @@ Actor.SetStance = function(actor, stance)
|
||||
Internal.SetUnitStance(actor, stance)
|
||||
end
|
||||
|
||||
Actor.OnDamaged = function(actor, eh)
|
||||
Actor.Trait(actor, "LuaScriptEvents").OnDamaged:Add(eh)
|
||||
end
|
||||
|
||||
Actor.OnKilled = function(actor, eh)
|
||||
Actor.Trait(actor, "LuaScriptEvents").OnKilled:Add(eh)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user