mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
Removed ray vectors, updated speed convert, removed thread creation for ray traces
This commit is contained in:
@@ -78,14 +78,11 @@ RADAR.rayTraces = {
|
|||||||
{ startVec = { x = 0.0, y = 5.0 }, endVec = { x = 0.0, y = 150.0 } },
|
{ startVec = { x = 0.0, y = 5.0 }, endVec = { x = 0.0, y = 150.0 } },
|
||||||
{ startVec = { x = -5.0, y = 15.0 }, endVec = { x = -5.0, y = 150.0 } },
|
{ startVec = { x = -5.0, y = 15.0 }, endVec = { x = -5.0, y = 150.0 } },
|
||||||
{ startVec = { x = 5.0, y = 15.0 }, endVec = { x = 5.0, y = 150.0 } }
|
{ startVec = { x = 5.0, y = 15.0 }, endVec = { x = 5.0, y = 150.0 } }
|
||||||
--{ startVec = { x = -12.0, y = 25.0 }, endVec = { x = -12.0, y = 150.0 } },
|
|
||||||
--{ startVec = { x = 12.0, y = 25.0 }, endVec = { x = 12.0, y = 150.0 } }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RADAR.sorting = {
|
RADAR.sorting = {
|
||||||
[1] = { name = "CLOSEST", func = function( a, b ) return a.dist < b.dist end },
|
[1] = { name = "CLOSEST", func = function( a, b ) return a.dist < b.dist end },
|
||||||
[2] = { name = "FASTEST", func = function( a, b ) return a.speed > b.speed end },
|
[2] = { name = "FASTEST", func = function( a, b ) return a.speed > b.speed end },
|
||||||
--[3] = { name = "FASTEST & CLOSEST", func = function( a, b ) return math.ceil( a.speed ) > math.ceil( b.speed ) and a.dist < b.dist end },
|
|
||||||
[3] = { name = "LARGEST", func = function( a, b ) return a.size > b.size end }
|
[3] = { name = "LARGEST", func = function( a, b ) return a.size > b.size end }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,10 +160,9 @@ end
|
|||||||
------------------------------------------------------------------------]]--
|
------------------------------------------------------------------------]]--
|
||||||
function RADAR:GetVehSpeedFormatted( speed )
|
function RADAR:GetVehSpeedFormatted( speed )
|
||||||
if ( self.vars.speedType == "mph" ) then
|
if ( self.vars.speedType == "mph" ) then
|
||||||
-- return GetEntitySpeed( veh ) * 2.236936
|
|
||||||
return math.ceil( speed * 2.236936 )
|
return math.ceil( speed * 2.236936 )
|
||||||
else
|
else
|
||||||
return GetEntitySpeed( veh ) * 3.6
|
return math.ceil( speed * 3.6 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -331,7 +327,6 @@ function RADAR:GetVehsHitByRay( ownVeh, vehs, s, e )
|
|||||||
end
|
end
|
||||||
|
|
||||||
function RADAR:CreateRayThread( vehs, from, startX, endX, endY )
|
function RADAR:CreateRayThread( vehs, from, startX, endX, endY )
|
||||||
--Citizen.CreateThread( function()
|
|
||||||
local startP = GetOffsetFromEntityInWorldCoords( from, startX, 0.0, 0.0 )
|
local startP = GetOffsetFromEntityInWorldCoords( from, startX, 0.0, 0.0 )
|
||||||
local endP = GetOffsetFromEntityInWorldCoords( from, endX, endY, 0.0 )
|
local endP = GetOffsetFromEntityInWorldCoords( from, endX, endY, 0.0 )
|
||||||
|
|
||||||
@@ -343,7 +338,6 @@ function RADAR:CreateRayThread( vehs, from, startX, endX, endY )
|
|||||||
|
|
||||||
print( "Ray thread: increasing ray state from " .. tostring( self:GetRayTraceState() ) .. " to " .. tostring( self:GetRayTraceState() + 1 ) )
|
print( "Ray thread: increasing ray state from " .. tostring( self:GetRayTraceState() ) .. " to " .. tostring( self:GetRayTraceState() + 1 ) )
|
||||||
self:IncreaseRayTraceState()
|
self:IncreaseRayTraceState()
|
||||||
--end )
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function RADAR:RunControlManager()
|
function RADAR:RunControlManager()
|
||||||
|
|||||||
Reference in New Issue
Block a user