mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 19:45:22 +09:00
Fixed A Few Bugs
This commit is contained in:
@@ -209,5 +209,6 @@ end)
|
||||
function Admin.bring(player,by_player)
|
||||
local player = Game.get_player(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)
|
||||
end
|
||||
@@ -49,16 +49,18 @@ function search_player(player)
|
||||
for category,items in pairs(_root_tree) do
|
||||
for _,_inventory in pairs(inventorys) do
|
||||
local inventory = player.get_inventory(_inventory)
|
||||
for _,item in pairs(items) do
|
||||
local found = inventory.remove(item)
|
||||
if found > 0 then take_action(player,item,category) end
|
||||
if inventory then
|
||||
for _,item in pairs(items) do
|
||||
local found = inventory.remove(item)
|
||||
if found > 0 then take_action(player,item,category) end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
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
|
||||
if #players == 0 then return end
|
||||
local player = players[math.random(#players)]
|
||||
|
||||
Reference in New Issue
Block a user