Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/fix.6881.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- (#6881) Fix tread splats spawning for units that are attached to a transport
13 changes: 13 additions & 0 deletions lua/defaultcomponents.lua
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,27 @@ TreadComponent = ClassSimple {

---@param self Unit | TreadComponent
CreateMovementEffects = function(self)
-- early exit: do not create treads if we do not have the blueprint
local treads = self.TreadBlueprint
if not treads then
return
end

-- early exit: do not create treads if we're in the air or on water
local layer = self.Layer
if layer == "Air" or layer == "Water" then
return
end

-- early exit: do not create treads if we are attached to something (like a transport)
if self:IsUnitState("Attached") then
return
end

if treads.ScrollTreads then
self:AddThreadScroller(1.0, treads.ScrollMultiplier or 0.2)
end

local treadMarks = treads.TreadMarks
local treadType = self.TerrainType.Treads
if treadMarks and treadType and treadType ~= 'None' then
Expand Down