From 0298a8e76e9f9ad186a9dac1bc61563ba8f517bd Mon Sep 17 00:00:00 2001 From: clyf Date: Sat, 25 May 2024 07:59:19 -0400 Subject: [PATCH] Fix various bugs with the behavior of external factories (#6192) --- changelog/snippets/fix.6192.md | 4 ++++ units/UEL0401/UEL0401_script.lua | 12 ++++++++++++ units/ZXA0003/ZXA0003_unit.bp | 25 +++++-------------------- 3 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 changelog/snippets/fix.6192.md diff --git a/changelog/snippets/fix.6192.md b/changelog/snippets/fix.6192.md new file mode 100644 index 0000000000..77f86fe249 --- /dev/null +++ b/changelog/snippets/fix.6192.md @@ -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 diff --git a/units/UEL0401/UEL0401_script.lua b/units/UEL0401/UEL0401_script.lua index 3211981a22..58156e03b9 100644 --- a/units/UEL0401/UEL0401_script.lua +++ b/units/UEL0401/UEL0401_script.lua @@ -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 diff --git a/units/ZXA0003/ZXA0003_unit.bp b/units/ZXA0003/ZXA0003_unit.bp index 1e3999e690..0087704764 100644 --- a/units/ZXA0003/ZXA0003_unit.bp +++ b/units/ZXA0003/ZXA0003_unit.bp @@ -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, -} \ No newline at end of file + SizeX = 0, + SizeY = 0, + SizeZ = 0, +}