mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Change to role.assign
This commit is contained in:
@@ -120,7 +120,7 @@ end
|
||||
function Role.assign(player,role,by_player,batch)
|
||||
local player = Game.get_player(player)
|
||||
if not player then error('Invalid player #1 given to Role.assign.',2) return end
|
||||
if not role then return end
|
||||
verbose('Assigning Roles: '..serpent.line(role)..' to: '..player.name)
|
||||
-- this loops over a table of role if given; will return if ipairs returns, else will asume it was ment to be a role and error
|
||||
if is_type(role,'table') and not role.name then
|
||||
local ctn = 0
|
||||
@@ -146,6 +146,7 @@ end
|
||||
function Role.unassign(player,role,by_player,batch)
|
||||
local player = Game.get_player(player)
|
||||
if not player then error('Invalid player #1 given to Role.unassign.',2) return end
|
||||
verbose('Assigning Roles: '..serpent.line(role)..' to: '..player.name)
|
||||
-- this loops over a table of role if given; will return if ipairs returns, else will asume it was ment to be a role and error
|
||||
if is_type(role,'table') and not role.name then
|
||||
local ctn = 0
|
||||
|
||||
@@ -45,7 +45,7 @@ global = _global{
|
||||
function ThisModule.remove_warp_point(name)
|
||||
local warp = global.warps[name]
|
||||
if not warp then return end
|
||||
local surface = warp.surface
|
||||
local surface = game.surfaces[warp.surface]
|
||||
local offset = warp.position
|
||||
local tiles = {}
|
||||
local tiles = {}
|
||||
@@ -102,7 +102,7 @@ function ThisModule.make_warp_point(position,surface,force,name)
|
||||
text='Warp: '..name,
|
||||
icon={type='item',name=warp_item}
|
||||
})
|
||||
global.warps[name] = {tag=tag,surface=surface,position=tag.position,old_tile=old_tile}
|
||||
global.warps[name] = {tag=tag,surface=surface.index,position=tag.position,old_tile=old_tile}
|
||||
local _temp = {Spawn=global.warps.Spawn}
|
||||
global.warps.Spawn = nil
|
||||
for name,data in pairs(table.keysort(global.warps)) do _temp[name] = data end
|
||||
@@ -133,7 +133,7 @@ local go_to_warp = Gui.inputs{
|
||||
if player.vehicle then player.vehicle.set_driver(nil) end
|
||||
if player.vehicle then player.vehicle.set_passenger(nil) end
|
||||
if player.vehicle then return end
|
||||
player.teleport(warp.surface.find_non_colliding_position('player',warp.position,32,1),warp.surface)
|
||||
player.teleport(game.surfaces[warp.surface].find_non_colliding_position('player',warp.position,32,1),game.surfaces[warp.surface])
|
||||
if not Role and not player.admin or Role and not Role.allowed(player,'always-warp') then
|
||||
event.element.parent.parent.parent.parent.style.visible = false
|
||||
global.cooldowns[event.player_index] = warp_limit
|
||||
@@ -161,7 +161,7 @@ ThisModule.Gui = Gui.left{
|
||||
}
|
||||
for name,warp in pairs(global.warps) do
|
||||
if not warp.tag or not warp.tag.valid then
|
||||
player.force.add_chart_tag(warp.surface,{
|
||||
player.force.add_chart_tag(game.surfaces[warp.surface],{
|
||||
position=warp.position,
|
||||
text='Warp: '..name,
|
||||
icon={type='item',name=warp_item}
|
||||
|
||||
Reference in New Issue
Block a user