mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
Fix comparator for all role types
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
--[[-- Command Types - Roles
|
--[[-- Command Types - Roles
|
||||||
The data types that are used with exp_roles
|
The data types that are used with exp_roles
|
||||||
|
A lower role index indicates it is more privileged
|
||||||
|
|
||||||
Adds parsers for:
|
Adds parsers for:
|
||||||
role
|
role
|
||||||
@@ -30,7 +31,7 @@ types.lower_role =
|
|||||||
--- @cast result any TODO role is not a defined type
|
--- @cast result any TODO role is not a defined type
|
||||||
|
|
||||||
local player_highest = highest_role(player)
|
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" }
|
return invalid{ "exp-commands-parse_role.lower-role" }
|
||||||
else
|
else
|
||||||
return valid(result)
|
return valid(result)
|
||||||
@@ -46,7 +47,7 @@ types.lower_role_player =
|
|||||||
|
|
||||||
local other_highest = highest_role(result)
|
local other_highest = highest_role(result)
|
||||||
local player_highest = highest_role(player)
|
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" }
|
return invalid{ "exp-commands-parse_role.lower-role-player" }
|
||||||
else
|
else
|
||||||
return valid(result)
|
return valid(result)
|
||||||
@@ -62,7 +63,7 @@ types.lower_role_player_online =
|
|||||||
|
|
||||||
local other_highest = highest_role(result)
|
local other_highest = highest_role(result)
|
||||||
local player_highest = highest_role(player)
|
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" }
|
return invalid{ "exp-commands-parse_role.lower-role-player" }
|
||||||
else
|
else
|
||||||
return valid(result)
|
return valid(result)
|
||||||
@@ -78,7 +79,7 @@ types.lower_role_player_alive =
|
|||||||
|
|
||||||
local other_highest = highest_role(result)
|
local other_highest = highest_role(result)
|
||||||
local player_highest = highest_role(player)
|
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" }
|
return invalid{ "exp-commands-parse_role.lower-role-player" }
|
||||||
else
|
else
|
||||||
return valid(result)
|
return valid(result)
|
||||||
|
|||||||
Reference in New Issue
Block a user