Module:ShipInfobox: Difference between revisions
Content deleted Content added
m Added automatic MaxCargo |
|||
| (10 intermediate revisions by the same user not shown) | |||
Line 145:
function Infobox.MaxCargo ( field, vars )
local output =
local number = 0
if HF.isempty(field.maxcargocapacity) then▼
if
end
output = output .. (tostring(field.S4) * 16)▼
end
output = output .. (tostring(field.S7) * 128)▼
number = number + (tonumber(field.S3) * 8)
return output▼
end
end
if not HF.isempty(field.S5) then
number = number + (tonumber(field.S5) * 32)
end
if not HF.isempty(field.S6) then
number = number + (tonumber(field.S6) * 64)
end
if not HF.isempty(field.S7) then
end
if not HF.isempty(field.S8) then
number = number + (tonumber(field.S8) * 256)
end
if number == 0 then
else
output = tostring(number)
end
else
output = field.Cargo
end
field.Value = output
return Infobox.Quantify(field, vars)
end
| |||