Merge pull request #850 from FlightControl-Master/FF-Servant

RANGE 1.0.3
This commit is contained in:
Frank 2018-03-30 19:56:36 +02:00 committed by GitHub
commit b415039947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -227,7 +227,7 @@ RANGE.id="RANGE | "
--- Range script version.
-- @field #number version
RANGE.version="1.0.2"
RANGE.version="1.0.3"
--TODO list
--TODO: Add statics for strafe pits.
@ -1573,6 +1573,9 @@ end
function RANGE:_GetAmmo(unitname)
self:F(unitname)
-- Init counter.
local ammo=0
local unit, playername = self:_GetPlayerUnitAndName(unitname)
if unit and playername then
@ -1580,7 +1583,7 @@ function RANGE:_GetAmmo(unitname)
local has_ammo=false
local ammotable=unit:GetAmmo()
self:E({ammotable=ammotable})
self:T2({ammotable=ammotable})
if ammotable ~= nil then
@ -1594,16 +1597,19 @@ function RANGE:_GetAmmo(unitname)
-- We are specifically looking for shells here.
if string.match(Tammo, "shell") then
-- Add up all shells
ammo=ammo+Nammo
local text=string.format("Player %s has %d rounds ammo of type %s", playername, Nammo, Tammo)
self:T(RANGE.id..text)
MESSAGE:New(text, 10):ToAllIf(self.Debug)
return Nammo
end
end
end
end
return 0
return ammo
end
--- Mark targets on F10 map.