1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-03-03 14:53:01 +02:00

Fixed exception in on_tick after well was removed. #44

This commit is contained in:
Valansch 2017-09-02 14:58:18 +02:00
parent 6e2e9230cb
commit a8865205e8
2 changed files with 8 additions and 3 deletions

View File

@ -2,6 +2,7 @@ require "util"
require "locale/utils/event"
require "config"
require "locale/utils/utils"
require "locale/utils/list_utils"
require "base_data"
require "user_groups"
require "chatlog"
@ -41,4 +42,4 @@ function walkabout(player_name, distance)
game.player.print("This command moved to /walkabout.")
end
Event.register(defines.events.on_player_created, player_joined)
Event.register(defines.events.on_player_created, player_joined)

View File

@ -1,6 +1,10 @@
function refill_well()
for _,well in pairs(global.wells) do
well.chest.insert({name = well.item, count = well.items_per_second * 15})
for _,well in pairs(global.wells) do
if well.chest.valid then
well.chest.insert({name = well.item, count = well.items_per_second * 15})
else
table.remove_element(global.wells, well)
end
end
end