mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
Updated some of the sort modes to be a bit more accurate
This commit is contained in:
28
cl_radar.lua
28
cl_radar.lua
@@ -81,10 +81,30 @@ RADAR.rayTraces = {
|
||||
}
|
||||
|
||||
RADAR.sorting = {
|
||||
[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 },
|
||||
[3] = { name = "LARGEST", func = function( a, b ) return a.size > b.size end },
|
||||
[4] = { name = "LARGEST & FASTEST", func = function( a, b ) return a.size > b.size and a.speed > b.speed 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
|
||||
},
|
||||
[3] = {
|
||||
name = "LARGEST",
|
||||
func = function( a, b ) return a.size > b.size + 1.0 end
|
||||
},
|
||||
[4] = {
|
||||
name = "LARGEST & FASTEST",
|
||||
func = function( a, b )
|
||||
if ( a.size > b.size + 2.0 ) then
|
||||
return true
|
||||
elseif ( a.size - b.size <= 2.0 ) then
|
||||
return false
|
||||
end
|
||||
|
||||
return a.speed > b.speed
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
--[[------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user