This commit is contained in:
2026-07-03 16:00:48 +09:00
parent 5645a3121d
commit 8644fedd86
2 changed files with 32 additions and 12 deletions
+8 -4
View File
@@ -5,13 +5,13 @@ function main.toggle(event)
return
end
local player = game.players[event.player_index]
if player.permission_group and not player.permission_group.allows_action(defines.input_action.toggle_map_editor) then
if not event.player_index then
return
end
if not player.admin then
local player = game.players[event.player_index]
if not player then
return
end
@@ -24,4 +24,8 @@ function main.toggle_editor(event)
game.tick_paused = false
end
function main.available(player)
player.set_shortcut_available('phi-cl-toggle-editor', player.admin and player.permission_group and player.permission_group.allows_action(defines.input_action.toggle_map_editor))
end
return main