mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 12:31:41 +09:00
Fixed A Few Bugs
This commit is contained in:
@@ -209,5 +209,6 @@ end)
|
|||||||
function Admin.bring(player,by_player)
|
function Admin.bring(player,by_player)
|
||||||
local player = Game.get_player(player)
|
local player = Game.get_player(player)
|
||||||
local _player = Game.get_player(by_player)
|
local _player = Game.get_player(by_player)
|
||||||
|
if not player or not _player then return end
|
||||||
player.teleport(_player.surface.find_non_colliding_position('player',_player.position,32,1),_player.surface)
|
player.teleport(_player.surface.find_non_colliding_position('player',_player.position,32,1),_player.surface)
|
||||||
end
|
end
|
||||||
@@ -49,16 +49,18 @@ function search_player(player)
|
|||||||
for category,items in pairs(_root_tree) do
|
for category,items in pairs(_root_tree) do
|
||||||
for _,_inventory in pairs(inventorys) do
|
for _,_inventory in pairs(inventorys) do
|
||||||
local inventory = player.get_inventory(_inventory)
|
local inventory = player.get_inventory(_inventory)
|
||||||
for _,item in pairs(items) do
|
if inventory then
|
||||||
local found = inventory.remove(item)
|
for _,item in pairs(items) do
|
||||||
if found > 0 then take_action(player,item,category) end
|
local found = inventory.remove(item)
|
||||||
|
if found > 0 then take_action(player,item,category) end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Event.register(defines.events.on_tick,function(event)
|
Event.register(defines.events.on_tick,function(event)
|
||||||
if (game.tick%1800) == 0 then
|
if (game.tick%900) == 0 then
|
||||||
local players = game.connected_players
|
local players = game.connected_players
|
||||||
if #players == 0 then return end
|
if #players == 0 then return end
|
||||||
local player = players[math.random(#players)]
|
local player = players[math.random(#players)]
|
||||||
|
|||||||
Reference in New Issue
Block a user