mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 20:16:38 +09:00
Fixed A Few Bugs
This commit is contained in:
@@ -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