1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-24 03:47:58 +02:00

Merge pull request #73 from ComfyFactory/update_pause_game

update module
This commit is contained in:
Gerkiz 2021-05-28 20:29:38 +02:00 committed by GitHub
commit 7f02560dc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,18 +1,22 @@
local Event = require 'utils.event'
local function halt_game()
local function set_pause()
game.tick_paused = true
end
local function resume_game()
game.tick_paused = false
local player_count = #game.connected_players
if player_count <= 1 then
game.tick_paused = false
end
end
local function player_left()
local player_count = #game.connected_players
if player_count == 0 then
halt_game()
set_pause()
end
end