Skip to content

Commit

Permalink
Fix veterancy loss on unit transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNukealizer authored and aeoncleanse committed Aug 28, 2017
1 parent 08cbdb0 commit 44f697a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/SimUtils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function TransferUnitsOwnership(units, ToArmyIndex)
-- B E F O R E
local numNukes = unit:GetNukeSiloAmmoCount() -- looks like one of these 2 works for SMDs also
local numTacMsl = unit:GetTacticalSiloAmmoCount()
local xp = unit.xp
local massKilled = unit.Sync.totalMassKilled
local unitHealth = unit:GetHealth()
local shieldIsOn = false
local ShieldHealth = 0
Expand Down Expand Up @@ -136,8 +136,8 @@ function TransferUnitsOwnership(units, ToArmyIndex)
end

-- A F T E R
if xp and xp > 0 then
unit:AddXP(xp)
if massKilled and massKilled > 0 then
unit:CalculateVeterancyLevel(massKilled)
end
if enh and table.getn(enh) > 0 then
for k, v in enh do
Expand Down

0 comments on commit 44f697a

Please sign in to comment.