Add startable legacy code

This commit is contained in:
Cooldude2606
2024-09-22 23:38:58 +01:00
parent 65145b5d34
commit 2a1206c498
163 changed files with 756 additions and 2573 deletions

View File

@@ -3,8 +3,8 @@
@commands Spawn
]]
local Commands = require 'expcore.commands' --- @dep expcore.commands
local Roles = require 'expcore.roles' --- @dep expcore.roles
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
local function teleport(player)
local surface = player.surface
@@ -52,12 +52,10 @@ Commands.new_command('go-to-spawn', {'expcom-spawn.description'}, 'Teleport to s
:register(function(player, action_player)
if not action_player then
return Commands.error{'expcom-spawn.unavailable'}
elseif action_player == player then
if not teleport(player) then
return Commands.error{'expcom-spawn.unavailable'}
end
elseif Roles.player_allowed(player, 'command/go-to-spawn/always') then
if not teleport(action_player) then
return Commands.error{'expcom-spawn.unavailable'}