Skip to content

Commit

Permalink
Fix various tactical missiles being unable to impact with the water s…
Browse files Browse the repository at this point in the history
…urface (FAForever#5785)
  • Loading branch information
lL1l1 authored Jan 5, 2024
1 parent 8cb1d7b commit 388b73d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 14 deletions.
10 changes: 8 additions & 2 deletions projectiles/CIFMissileTactical02/CIFMissileTactical02_Script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ CIFMissileTactical02 = ClassProjectile(CLOATacticalMissileProjectile) {
---@param self CIFMissileTactical02
OnCreate = function(self)
CLOATacticalMissileProjectile.OnCreate(self)
self.MoveThread = self.Trash:Add(ForkThread( self.MovementThread,self ))
self.MoveThread = self.Trash:Add(ForkThread(self.MovementThread, self))
end,

---@param self CIFMissileTactical02
OnExitWater = function(self)
CLOATacticalMissileProjectile.OnExitWater(self)
self:SetDestroyOnWater(true)
end,
}
TypeClass = CIFMissileTactical02
TypeClass = CIFMissileTactical02
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
local SLaanseTacticalMissile = import("/lua/seraphimprojectiles.lua").SLaanseTacticalMissile
local TacticalMissileComponent = import('/lua/sim/DefaultProjectiles.lua').TacticalMissileComponent

--- Used by the ACU
--- Used by xsl0001
---@class SIFLaanseTacticalMissileCDR : SLaanseTacticalMissile, TacticalMissileComponent
SIFLaanseTacticalMissileCDR = ClassProjectile(SLaanseTacticalMissile, TacticalMissileComponent) {

Expand All @@ -40,9 +40,19 @@ SIFLaanseTacticalMissileCDR = ClassProjectile(SLaanseTacticalMissile, TacticalMi
FinalBoostAngleRange = 0,

---@param self SIFLaanseTacticalMissileCDR
OnCreate = function(self)
---@param inWater boolean
OnCreate = function(self, inWater)
SLaanseTacticalMissile.OnCreate(self)
self.MoveThread = self.Trash:Add(ForkThread(self.MovementThread,self))
if not inWater then
self:SetDestroyOnWater(true)
end
self.MoveThread = self.Trash:Add(ForkThread(self.MovementThread, self))
end,

---@param self SIFLaanseTacticalMissileCDR
OnExitWater = function(self)
SLaanseTacticalMissile.OnExitWater(self)
self:SetDestroyOnWater(true)
end,
}
TypeClass = SIFLaanseTacticalMissileCDR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
local SLaanseTacticalMissile = import("/lua/seraphimprojectiles.lua").SLaanseTacticalMissile
local TacticalMissileComponent = import('/lua/sim/DefaultProjectiles.lua').TacticalMissileComponent

--- Used by the ACU
--- Used by xsl0301
---@class SIFLaanseTacticalMissileSCU : SLaanseTacticalMissile, TacticalMissileComponent
SIFLaanseTacticalMissileSCU = ClassProjectile(SLaanseTacticalMissile, TacticalMissileComponent) {

Expand All @@ -40,10 +40,19 @@ SIFLaanseTacticalMissileSCU = ClassProjectile(SLaanseTacticalMissile, TacticalMi
FinalBoostAngleRange = 0,

---@param self SIFLaanseTacticalMissileSCU
OnCreate = function(self)
---@param inWater boolean
OnCreate = function(self, inWater)
SLaanseTacticalMissile.OnCreate(self)
if not inWater then
self:SetDestroyOnWater(true)
end
self.MoveThread = self.Trash:Add(ForkThread(self.MovementThread, self))
end,
}

---@param self SIFLaanseTacticalMissileSCU
OnExitWater = function(self)
SLaanseTacticalMissile.OnExitWater(self)
self:SetDestroyOnWater(true)
end,
}
TypeClass = SIFLaanseTacticalMissileSCU
10 changes: 7 additions & 3 deletions projectiles/TIFMissileCruiseCDR/TIFMissileCruiseCDR_Script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,18 @@ TIFMissileCruiseCDR = ClassProjectile(TMissileCruiseProjectile) {
FinalBoostAngle = 30,

---@param self TIFMissileCruiseCDR
OnCreate = function(self)
---@param inWater boolean
OnCreate = function(self, inWater)
TMissileCruiseProjectile.OnCreate(self)
if not inWater then
self:SetDestroyOnWater(true)
end
self.MoveThread = self.Trash:Add(ForkThread(self.MovementThread, self))
end,

---@param self TIFMissileCruiseCDR
OnEnterWater = function(self)
TMissileCruiseProjectile.OnEnterWater(self)
OnExitWater = function(self)
TMissileCruiseProjectile.OnExitWater(self)
self:SetDestroyOnWater(true)
end,
}
Expand Down
10 changes: 7 additions & 3 deletions projectiles/TIFMissileNukeCDR/TIFMissileNukeCDR_Script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ TIFMissileNukeCDR = ClassProjectile(TIFMissileNuke, TacticalMissileComponent) {
MovementThread = TacticalMissileComponent.MovementThread,

---@param self TIFMissileNukeCDR
OnCreate = function(self)
---@param inWater boolean
OnCreate = function(self, inWater)
TIFMissileNuke.OnCreate(self)
if not inWater then
self:SetDestroyOnWater(true)
end
self.MoveThread = self.Trash:Add(ForkThread(self.MovementThread, self))
self.effectEntityPath = '/effects/Entities/UEFNukeEffectController02/UEFNukeEffectController02_proj.bp'
self:LauncherCallbacks()
Expand All @@ -55,8 +59,8 @@ TIFMissileNukeCDR = ClassProjectile(TIFMissileNuke, TacticalMissileComponent) {
end,

---@param self TIFMissileNukeCDR
OnEnterWater = function(self)
TIFMissileNuke.OnEnterWater(self)
OnExitWater = function(self)
TIFMissileNuke.OnExitWater(self)
self:SetDestroyOnWater(true)
end,
}
Expand Down

0 comments on commit 388b73d

Please sign in to comment.