Skip to content

Commit

Permalink
Share tarmacs when gifting a structure (#4869)
Browse files Browse the repository at this point in the history
  • Loading branch information
Garanas committed Apr 13, 2023
1 parent 3650aea commit cc7e754
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/SimUtils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ function TransferUnitsOwnership(units, toArmy, captured)
local numTacMsl = unit:GetTacticalSiloAmmoCount()
local massKilled = unit.VetExperience
local unitHealth = unit:GetHealth()
local tarmacs = unit.TarmacBag
local shieldIsOn = false
local shieldHealth = 0
local hasFuel = false
Expand Down Expand Up @@ -217,6 +218,10 @@ function TransferUnitsOwnership(units, toArmy, captured)
if hasFuel then
newUnit:SetFuelRatio(fuelRatio)
end

if tarmacs then
newUnit.TarmacBag = tarmacs
end

if numNukes and numNukes > 0 then
newUnit:GiveNukeSiloAmmo(numNukes - newUnit:GetNukeSiloAmmoCount())
Expand Down

0 comments on commit cc7e754

Please sign in to comment.