From 84d63733fe9848204780e246aef7ac7081b18186 Mon Sep 17 00:00:00 2001 From: Distortions81 Date: Fri, 17 Jan 2025 17:00:13 -0700 Subject: [PATCH] context cancel --- support/factLauncher.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/support/factLauncher.go b/support/factLauncher.go index 17319e50..6d1d13d5 100755 --- a/support/factLauncher.go +++ b/support/factLauncher.go @@ -477,9 +477,14 @@ func launchFactorio() { glob.BootMessage = disc.SmartEditDiscordEmbed(cfg.Local.Channel.ChatChannel, glob.BootMessage, "Status", "Loading mods...", glob.COLOR_GREEN) } + if glob.FactorioCancel != nil { + cwlog.DoLogCW("Canceling existing context.") + glob.FactorioCancel() + } if glob.FactorioCmd != nil { if isProcessRunning(glob.FactorioCmd) || isProcessAlive(glob.FactorioCmd.Process.Pid) { - cwlog.DoLogCW("Previous Factorio process appears to be hard locked, killing process.") + cwlog.DoLogCW("Killing Previous Factorio process.") + glob.FactorioCmd.Process.Kill() glob.FactorioCmd.Wait() }