@@ -255,11 +255,11 @@ local function handle_grant_command(caller, grantname, grantprivstr)
255
255
if privs_unknown ~= " " then
256
256
return false , privs_unknown
257
257
end
258
+ core .set_player_privs (grantname , privs )
258
259
for priv , _ in pairs (grantprivs ) do
259
260
-- call the on_grant callbacks
260
261
core .run_priv_callbacks (grantname , priv , caller , " grant" )
261
262
end
262
- core .set_player_privs (grantname , privs )
263
263
core .log (" action" , caller .. ' granted (' .. core .privs_to_string (grantprivs , ' , ' ).. ' ) privileges to ' .. grantname )
264
264
if grantname ~= caller then
265
265
core .chat_send_player (grantname ,
@@ -359,13 +359,13 @@ local function handle_revoke_command(caller, revokename, revokeprivstr)
359
359
end
360
360
361
361
local revokecount = 0
362
+
363
+ core .set_player_privs (revokename , privs )
362
364
for priv , _ in pairs (revokeprivs ) do
363
365
-- call the on_revoke callbacks
364
366
core .run_priv_callbacks (revokename , priv , caller , " revoke" )
365
367
revokecount = revokecount + 1
366
368
end
367
-
368
- core .set_player_privs (revokename , privs )
369
369
local new_privs = core .get_player_privs (revokename )
370
370
371
371
if revokecount == 0 then
0 commit comments