From 2a1f3dea2c20cdcf4993f2e801b0d771124386e6 Mon Sep 17 00:00:00 2001 From: Gerkiz Date: Fri, 28 May 2021 20:28:28 +0200 Subject: [PATCH] update module --- utils/pause_game.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/pause_game.lua b/utils/pause_game.lua index 326a0783..7725c8dd 100644 --- a/utils/pause_game.lua +++ b/utils/pause_game.lua @@ -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