mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
Cleaned up ray thread code a bit, swapped light if for inline if
This commit is contained in:
17
cl_radar.lua
17
cl_radar.lua
@@ -127,8 +127,8 @@ RADAR.rayTraces = {
|
|||||||
-- { startVec = { x = 0.0, y = 5.0 }, endVec = { x = 0.0, y = 150.0 }, rayType = "same" },
|
-- { startVec = { x = 0.0, y = 5.0 }, endVec = { x = 0.0, y = 150.0 }, rayType = "same" },
|
||||||
-- { startVec = { x = -5.0, y = 15.0 }, endVec = { x = -5.0, y = 150.0 }, rayType = "same" },
|
-- { startVec = { x = -5.0, y = 15.0 }, endVec = { x = -5.0, y = 150.0 }, rayType = "same" },
|
||||||
-- { startVec = { x = 5.0, y = 15.0 }, endVec = { x = 5.0, y = 150.0 }, rayType = "same" },
|
-- { startVec = { x = 5.0, y = 15.0 }, endVec = { x = 5.0, y = 150.0 }, rayType = "same" },
|
||||||
{ startVec = { x = 0.0, y = 5.0 }, endVec = { x = 0.0, y = 150.0 }, rayType = "same" },
|
{ startVec = { x = 0.0 }, endVec = { x = 0.0, y = 150.0 }, rayType = "same" },
|
||||||
{ startVec = { x = -10.0, y = 15.0 }, endVec = { x = -10.0, y = 150.0 }, rayType = "opp" }
|
{ startVec = { x = -10.0 }, endVec = { x = -10.0, y = 150.0 }, rayType = "opp" }
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Each of these are used for sorting the captured vehicle data, depending on what the
|
-- Each of these are used for sorting the captured vehicle data, depending on what the
|
||||||
@@ -336,17 +336,14 @@ function RADAR:GetVehsHitByRay( ownVeh, vehs, s, e )
|
|||||||
end
|
end
|
||||||
|
|
||||||
function RADAR:CreateRayThread( vehs, from, startX, endX, endY, rayType )
|
function RADAR:CreateRayThread( vehs, from, startX, endX, endY, rayType )
|
||||||
-- 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 )
|
|
||||||
|
|
||||||
local hitVehs = self:GetVehsHitByRay( from, vehs, startP, endP )
|
local hitVehs = self:GetVehsHitByRay( from, vehs, startP, endP )
|
||||||
|
|
||||||
self:InsertCapturedVehicleData( hitVehs, rayType )
|
self:InsertCapturedVehicleData( hitVehs, rayType )
|
||||||
|
|
||||||
-- UTIL:DebugPrint( "Ray thread: increasing ray state from " .. tostring( self:GetRayTraceState() ) .. " to " .. tostring( self:GetRayTraceState() + 1 ) )
|
self:IncreaseRayTraceState()
|
||||||
self:IncreaseRayTraceState()
|
|
||||||
-- end )
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function RADAR:CreateRayThreads( ownVeh, vehicles )
|
function RADAR:CreateRayThreads( ownVeh, vehicles )
|
||||||
|
|||||||
@@ -156,9 +156,11 @@ function setLight( ant, cat, item, state )
|
|||||||
let obj = elements.antennas[ant][cat][item];
|
let obj = elements.antennas[ant][cat][item];
|
||||||
|
|
||||||
if ( state ) {
|
if ( state ) {
|
||||||
if ( cat == "dirs" ) { obj.addClass( "active_arrow" ) } else { obj.addClass( "active" ) };
|
// if ( cat == "dirs" ) { obj.addClass( "active_arrow" ) } else { obj.addClass( "active" ) };
|
||||||
|
cat == "dirs" ? obj.addClass( "active_arrow" ) : obj.addClass( "active" );
|
||||||
} else {
|
} else {
|
||||||
if ( cat == "dirs" ) { obj.removeClass( "active_arrow" ) } else { obj.removeClass( "active" ) };
|
// if ( cat == "dirs" ) { obj.removeClass( "active_arrow" ) } else { obj.removeClass( "active" ) };
|
||||||
|
cat == "dirs" ? obj.removeClass( "active_arrow" ) : obj.removeClass( "active" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user