Fix comparator for all role types

This commit is contained in:
Cooldude2606
2025-01-03 23:32:34 +00:00
parent 4a087a3324
commit 1042897d0f

View File

@@ -1,6 +1,7 @@
--[[-- Command Types - Roles
The data types that are used with exp_roles
A lower role index indicates it is more privileged
Adds parsers for:
role
@@ -30,7 +31,7 @@ types.lower_role =
--- @cast result any TODO role is not a defined type
local player_highest = highest_role(player)
if player_highest.index < result.index then
if player_highest.index >= result.index then
return invalid{ "exp-commands-parse_role.lower-role" }
else
return valid(result)
@@ -46,7 +47,7 @@ types.lower_role_player =
local other_highest = highest_role(result)
local player_highest = highest_role(player)
if player_highest.index < other_highest.index then
if player_highest.index >= other_highest.index then
return invalid{ "exp-commands-parse_role.lower-role-player" }
else
return valid(result)
@@ -62,7 +63,7 @@ types.lower_role_player_online =
local other_highest = highest_role(result)
local player_highest = highest_role(player)
if player_highest.index < other_highest.index then
if player_highest.index >= other_highest.index then
return invalid{ "exp-commands-parse_role.lower-role-player" }
else
return valid(result)
@@ -78,7 +79,7 @@ types.lower_role_player_alive =
local other_highest = highest_role(result)
local player_highest = highest_role(player)
if player_highest.index < other_highest.index then
if player_highest.index >= other_highest.index then
return invalid{ "exp-commands-parse_role.lower-role-player" }
else
return valid(result)