Skip to content

Commit

Permalink
Replace self:GetLauncher()
Browse files Browse the repository at this point in the history
self:GetLauncher() > self.Launcher
  • Loading branch information
MrRowey committed Dec 18, 2024
1 parent 508885d commit bf10535
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion effects/Entities/SCUDeath01/SCUDeath01_script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lua/sim/CollisionBeam.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lua/sim/Projectile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lua/sim/projectiles/OverchargeProjectile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion projectiles/X1Mercy_proj/X1Mercy_script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf10535

Please sign in to comment.