Skip to content

Commit

Permalink
Fix various bugs with the behavior of external factories (FAForever#6192
Browse files Browse the repository at this point in the history
)
  • Loading branch information
clyfordv authored May 25, 2024
1 parent 9830fc5 commit 0298a8e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
4 changes: 4 additions & 0 deletions changelog/snippets/fix.6192.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(#6192) Removes an erroneous structure footprint from the dummy unit of external factories

(#6192) Fix a bug where deploying when building a unit in the external factory would detach the unit under construction
- Applies to/is fixed in the fatboy, but any non-carrier external factory with deploy capability would have this issue
12 changes: 12 additions & 0 deletions units/UEL0401/UEL0401_script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,18 @@ UEL0401 = ClassUnit(TMobileFactoryUnit, ExternalFactoryComponent) {
end
end,

---Fixes a bug with external factories where ordering "deploy" will detach the unit under construction
---@param self UEL0401
---@param attachBone string
---@param unit Unit
OnTransportDetach = function(self, attachBone, unit)
if not self.Dead and not unit.Dead and unit:GetFractionComplete() < 1.0 then
unit:AttachBoneTo(-2, self, attachBone)
else
TMobileFactoryUnit.OnTransportDetach(self, attachBone, unit)
end
end,

IdleState = State {
---@param self UEL0401
---@param unitBeingBuilt Unit
Expand Down
25 changes: 5 additions & 20 deletions units/ZXA0003/ZXA0003_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,18 @@ UnitBlueprint{
Economy = {
BuildCostEnergy = 0,
BuildCostMass = 0,
BuildRate = 0.0001,
BuildTime = 0,
MaxBuildDistance = 100,
},
Footprint = {
MaxSlope = 0.25,
SizeX = 1,
SizeZ = 1,
},
General = {
CapCost = 0,
Category = '',
SelectionPriority = 3,
},
Intel = { VisionRadius = 0 },
Physics = {
BankingSlope = 0.5,
BuildOnLayerCaps = {
LAYER_Air = true,
LAYER_Land = false,
LAYER_Orbit = false,
LAYER_Seabed = false,
LAYER_Sub = false,
LAYER_Water = false,
},
MotionType = "RULEUMT_None",
},
SizeX = 0.01,
SizeY = 0.01,
SizeZ = 0.01,
}
SizeX = 0,
SizeY = 0,
SizeZ = 0,
}

0 comments on commit 0298a8e

Please sign in to comment.