mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Fixing a bug where on a rare condition, an A10CII could be spawned and the SpawnInitSADL of the Spawn object wouldn't be set correctly (#2108)
This commit is contained in:
parent
70c29de695
commit
874fa7ad69
@ -3538,6 +3538,8 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) -- R2.2
|
|||||||
if tonumber(SpawnTemplate.units[UnitID].AddPropAircraft.SADL_TN) ~= nil then
|
if tonumber(SpawnTemplate.units[UnitID].AddPropAircraft.SADL_TN) ~= nil then
|
||||||
local octal = SpawnTemplate.units[UnitID].AddPropAircraft.SADL_TN
|
local octal = SpawnTemplate.units[UnitID].AddPropAircraft.SADL_TN
|
||||||
local num = UTILS.OctalToDecimal(octal)
|
local num = UTILS.OctalToDecimal(octal)
|
||||||
|
self.SpawnInitSADL = num -- we arrived here seeing that self.SpawnInitSADL == nil, but now that we have a SADL (num), we also need to set it to self.SpawnInitSADL in case
|
||||||
|
-- we need to get the next SADL from _DATABASE, or else UTILS.OctalToDecimal() will fail in GetNextSADL
|
||||||
if _DATABASE.SADL[num] ~= nil or UnitID > 1 then -- SADL taken or next unit
|
if _DATABASE.SADL[num] ~= nil or UnitID > 1 then -- SADL taken or next unit
|
||||||
octal = _DATABASE:GetNextSADL(self.SpawnInitSADL,SpawnTemplate.units[UnitID].name)
|
octal = _DATABASE:GetNextSADL(self.SpawnInitSADL,SpawnTemplate.units[UnitID].name)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user