This commit is contained in:
Frank 2018-10-18 22:51:51 +02:00
parent 7d7c521bce
commit 223de9d1aa
2 changed files with 7 additions and 11 deletions

View File

@ -395,8 +395,6 @@ function CARRIERTRAINER:_CheckPlayerStatus()
if playerData then
self:I("player "..playerData.callsign)
-- Player unit.
local unit = playerData.unit
@ -940,9 +938,6 @@ function CARRIERTRAINER:_Ninety(playerData)
local idealAltitude = 500
local score, hint=self:_AltitudeCheck(playerData, self.Ninety)
self:_SendMessageToPlayer( hint, 8, playerData )
self:_PrintAltitudeFeedback(altitude, idealAltitude, playerData)
--local aoa = math.deg(mist.getAoA(playerData.mistUnit))
local aoa = playerData.unit:GetAoA()
local aoaFeedback = self:_PrintAoAFeedback(aoa, 8.1, playerData)
@ -979,9 +974,6 @@ function CARRIERTRAINER:_Wake(playerData)
local idealAltitude = 370
local score, hint=self:_AltitudeCheck(playerData, self.Wake)
self:_SendMessageToPlayer( hint, 8, playerData )
self:_PrintAltitudeFeedback(altitude, idealAltitude, playerData)
local aoa = playerData.unit:GetAoA()
local aoaFeedback = self:_PrintAoAFeedback(aoa, 8.1, playerData)

View File

@ -276,7 +276,7 @@ RANGE.id="RANGE | "
--- Range script version.
-- @field #string version
RANGE.version="1.2.1"
RANGE.version="1.2.2"
--TODO list:
--TODO: Add custom weapons, which can be specified by the user.
@ -1161,11 +1161,13 @@ function RANGE:OnEventShot(EventData)
local _callsign=self:_myname(_unitName)
-- Coordinate of impact point.
local impactcoord=COORDINATE:NewFromVec3(_lastBombPos)
local impactcoord=COORDINATE:NewFromVec3(_lastBombPos)
-- Distance from range. We dont want to smoke targets outside of the range.
local impactdist=impactcoord:Get2DDistance(self.location)
--impactcoord:MarkToAll("Bomb impact point")
-- Smoke impact point of bomb.
if self.PlayerSettings[_playername].smokebombimpact and impactdist<self.rangeradius then
if self.PlayerSettings[_playername].delaysmoke then
@ -1184,6 +1186,8 @@ function RANGE:OnEventShot(EventData)
-- Distance between bomb and target.
local _temp = impactcoord:Get2DDistance(_target:GetCoordinate())
--env.info(string.format("FF target = %s dist = %d m", _target:GetName(), _temp))
-- Find closest target to last known position of the bomb.
if _distance == nil or _temp < _distance then
@ -1225,7 +1229,7 @@ function RANGE:OnEventShot(EventData)
elseif _distance <= self.rangeradius then
-- Send message
local _message=string.format("%s, weapon fell more than %.1f km away from nearest range target. No score!", _callsign, self.scorebombdistance/1000)
self:_DisplayMessageToGroup(_unit, _message, nil, true)
self:_DisplayMessageToGroup(_unit, _message, nil, false)
end
--Terminate the timer