From bf10535d06fe725b76f90aab70cd91ce849c30ae Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 18 Dec 2024 13:44:05 +0000 Subject: [PATCH] Replace self:GetLauncher() self:GetLauncher() > self.Launcher --- effects/Entities/SCUDeath01/SCUDeath01_script.lua | 2 +- lua/sim/CollisionBeam.lua | 4 ++-- lua/sim/Projectile.lua | 4 ++-- lua/sim/projectiles/OverchargeProjectile.lua | 2 +- projectiles/X1Mercy_proj/X1Mercy_script.lua | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/effects/Entities/SCUDeath01/SCUDeath01_script.lua b/effects/Entities/SCUDeath01/SCUDeath01_script.lua index cd01020d58..2e9da11c6b 100644 --- a/effects/Entities/SCUDeath01/SCUDeath01_script.lua +++ b/effects/Entities/SCUDeath01/SCUDeath01_script.lua @@ -29,7 +29,7 @@ SCUDeath01 = Class(NullShell) { ---@param damageData table PassDamageData = function(self, damageData) NullShell.PassMetaDamage(self, damageData) - local instigator = self:GetLauncher() + local instigator = self.Launcher if instigator == nil then instigator = self end diff --git a/lua/sim/CollisionBeam.lua b/lua/sim/CollisionBeam.lua index 0bf3e84b39..ecbf13d5e7 100644 --- a/lua/sim/CollisionBeam.lua +++ b/lua/sim/CollisionBeam.lua @@ -295,7 +295,7 @@ CollisionBeam = Class(moho.CollisionBeamEntity) { -- 'Shield' if impactType == 'Unit' or impactType == 'UnitAir' or impactType == 'UnitUnderwater' then - if not self:GetLauncher() then + if not self.Launcher then return end @@ -316,7 +316,7 @@ CollisionBeam = Class(moho.CollisionBeamEntity) { end -- Do Damage - self:DoDamage(self:GetLauncher(), damageData, targetEntity) + self:DoDamage(self.Launcher, damageData, targetEntity) local ImpactEffects = {} local ImpactEffectScale = 1 diff --git a/lua/sim/Projectile.lua b/lua/sim/Projectile.lua index c6bd350623..76f5d097bb 100644 --- a/lua/sim/Projectile.lua +++ b/lua/sim/Projectile.lua @@ -145,7 +145,7 @@ Projectile = ClassProjectile(ProjectileMethods, DebugProjectileComponent) { self.Blueprint = blueprint self.Trash = trash self.Army = EntityGetArmy(self) --[[@as number]] - self.Launcher = self:GetLauncher() --[[@as Unit]] + self.Launcher = self.Launcher --[[@as Unit]] -- set some health, if we have some local maxHealth = blueprint.Defense.MaxHealth @@ -760,7 +760,7 @@ Projectile = ClassProjectile(ProjectileMethods, DebugProjectileComponent) { for k, v in data.Buffs do if v.Add.OnImpact == true then if v.AppliedToTarget ~= true or (v.Radius and v.Radius > 0) then - target = self:GetLauncher() + target = self.Launcher end -- Check for target validity if target and IsUnit(target) then diff --git a/lua/sim/projectiles/OverchargeProjectile.lua b/lua/sim/projectiles/OverchargeProjectile.lua index d6317ba3fa..ce787df720 100644 --- a/lua/sim/projectiles/OverchargeProjectile.lua +++ b/lua/sim/projectiles/OverchargeProjectile.lua @@ -50,7 +50,7 @@ OverchargeProjectile = ClassSimple { -- Stop us doing blueprint damage in the other OnImpact call if we ditch this one without resetting self.DamageData self.DamageData.DamageAmount = 0 - local launcher = self:GetLauncher() + local launcher = self.Launcher if not launcher then return end diff --git a/projectiles/X1Mercy_proj/X1Mercy_script.lua b/projectiles/X1Mercy_proj/X1Mercy_script.lua index f9d0aba239..b9a5c8d5f7 100644 --- a/projectiles/X1Mercy_proj/X1Mercy_script.lua +++ b/projectiles/X1Mercy_proj/X1Mercy_script.lua @@ -28,7 +28,7 @@ X1Mercy = Class(AMiasmaProjectile) { OnCreate = function(self) AMiasmaProjectile.OnCreate(self) - local launcher = self:GetLauncher() + local launcher = self.Launcher if launcher and not launcher:IsDead() then launcher:ProjectileFired() end