diff --git a/changelog/snippets/other.6601 b/changelog/snippets/other.6601 new file mode 100644 index 0000000000..72ebad3ec5 --- /dev/null +++ b/changelog/snippets/other.6601 @@ -0,0 +1 @@ +- (#6601) Expanded an AI related callback for when TML missiles are intercepted by TMD \ No newline at end of file diff --git a/lua/sim/Projectile.lua b/lua/sim/Projectile.lua index c6bd350623..a9267e0397 100644 --- a/lua/sim/Projectile.lua +++ b/lua/sim/Projectile.lua @@ -309,7 +309,7 @@ Projectile = ClassProjectile(ProjectileMethods, DebugProjectileComponent) { -- callbacks for launcher to have an idea what is going on for AIs local launcher = self.Launcher if not IsDestroyed(launcher) then - launcher:OnMissileIntercepted(self:GetCurrentTargetPosition(), instigator, self:GetPosition()) + launcher:OnMissileIntercepted(self:GetCurrentTargetPosition(), instigator, self:GetPosition(), self) -- keep track of the number of intercepted missiles if not IsDestroyed(instigator) and instigator.GetStat then diff --git a/lua/sim/Unit.lua b/lua/sim/Unit.lua index 2537e59a22..67a7823d84 100644 --- a/lua/sim/Unit.lua +++ b/lua/sim/Unit.lua @@ -5083,7 +5083,8 @@ Unit = ClassUnit(moho.unit_methods, IntelComponent, VeterancyComponent, DebugUni ---@param target Vector ---@param defense Unit Requires an `IsDestroyed` check as the defense may have been destroyed when the missile is intercepted ---@param position Vector Location where the missile got intercepted - OnMissileIntercepted = function(self, target, defense, position) + ---@param self Unit + OnMissileIntercepted = function(self, target, defense, position, self) -- try and run callbacks if self.EventCallbacks['OnMissileIntercepted'] then for k, callback in self.EventCallbacks['OnMissileIntercepted'] do