1.5.1 Disband manpower bug?
Posted: Mon Aug 04, 2014 1:14 pm
Searched forums but did not find anything on this so maybe it is intended.
Anyways if you disband a unit Mp is calculated using .costPP as base (see code below).
For exemple if Austria disbands their BB they get 124 Mp. If you disband a garrison you get 10 Mp back etc.
function GetDisbandRefund(unit)
local PPrefund
local MPrefund
if unit.type ~= Unit.NAVAL then
if unit.hex.originalFaction.alliance.id == unit.faction.alliance.id then
if unit.hex.originalFaction.id == unit.faction.id then
PPrefund = math.floor(unit.prototype.costPP * unit.hp * 50 / 10000)
else
PPrefund = math.floor(unit.prototype.costPP * unit.hp * 25 / 10000)
end
else
PPrefund = 0
end
if unit.hex.originalFaction.alliance.id == unit.faction.alliance.id then
if unit.hex.originalFaction.id == unit.faction.id then
* MPrefund = math.floor(unit.prototype.costPP * unit.hp * 100 / 10000)
else
* MPrefund = math.floor(unit.prototype.costPP * unit.hp * 50 / 10000)
end
else
MPrefund = 0
end
else
PPrefund = math.floor(unit.prototype.costPP * unit.hp * 50 / 10000)
* MPrefund = math.floor(unit.prototype.costPP * unit.hp * 100 / 10000)
return PPrefund, MPrefund
end
Anyways if you disband a unit Mp is calculated using .costPP as base (see code below).
For exemple if Austria disbands their BB they get 124 Mp. If you disband a garrison you get 10 Mp back etc.
function GetDisbandRefund(unit)
local PPrefund
local MPrefund
if unit.type ~= Unit.NAVAL then
if unit.hex.originalFaction.alliance.id == unit.faction.alliance.id then
if unit.hex.originalFaction.id == unit.faction.id then
PPrefund = math.floor(unit.prototype.costPP * unit.hp * 50 / 10000)
else
PPrefund = math.floor(unit.prototype.costPP * unit.hp * 25 / 10000)
end
else
PPrefund = 0
end
if unit.hex.originalFaction.alliance.id == unit.faction.alliance.id then
if unit.hex.originalFaction.id == unit.faction.id then
* MPrefund = math.floor(unit.prototype.costPP * unit.hp * 100 / 10000)
else
* MPrefund = math.floor(unit.prototype.costPP * unit.hp * 50 / 10000)
end
else
MPrefund = 0
end
else
PPrefund = math.floor(unit.prototype.costPP * unit.hp * 50 / 10000)
* MPrefund = math.floor(unit.prototype.costPP * unit.hp * 100 / 10000)
return PPrefund, MPrefund
end