From 689c680be86fbb82c60ad66729f7e8da56fcce0f Mon Sep 17 00:00:00 2001 From: empathicqubit Date: Wed, 28 Apr 2021 04:33:52 -0400 Subject: [PATCH] Fix more Windows issues --- config.lua | 2 +- runner-wrapper.lua | 2 +- runner.lua | 9 +++++++-- util.lua | 2 ++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config.lua b/config.lua index 967cad7..126f2e6 100644 --- a/config.lua +++ b/config.lua @@ -36,7 +36,7 @@ _M.StartPowerup = 0 _M.NeatConfig = { Threads = 2, -ThreadDontQuit = true, +ThreadDontQuit = false, --Filename = "DP1.state", SaveFile = _M.Filename .. ".pool", Filename = _M.Filename, diff --git a/runner-wrapper.lua b/runner-wrapper.lua index 8dc68ee..4e24e4f 100644 --- a/runner-wrapper.lua +++ b/runner-wrapper.lua @@ -19,7 +19,7 @@ for i=1,#temps,1 do end end -local tmpFileName = tempDir.."donk_runner" +local tmpFileName = tempDir.."/donk_runner" local function message(_M, msg, color) if color == nil then diff --git a/runner.lua b/runner.lua index a5de554..9a7bb29 100644 --- a/runner.lua +++ b/runner.lua @@ -256,6 +256,11 @@ function displayForm(_M) gui.rectangle(0, 0, 500, guiHeight, 1, 0x00ffffff, 0xbb000000) --gui.circle(game.screenX-84, game.screenY-84, 192 / 2, 1, 0x50000000) + local rightmost = _M.rightmost[_M.currentArea] + if rightmost == nil then + rightmost = 0 + end + gui.text(5, 30, "Timeout: " .. _M.timeout) gui.text(5, 5, "Generation: " .. _M.currentGenerationIndex) gui.text(130, 5, "Species: " .. _M.currentSpecies.id) @@ -271,7 +276,7 @@ function displayForm(_M) gui.text(230, 65, "Damage: " .. _M.partyHitCounter) gui.text(230, 80, "PowerUp: " .. _M.powerUpCounter) gui.text(320, 65, string.format("Current Area: %04x", _M.currentArea)) - gui.text(320, 80, "Rightmost: ".._M.rightmost[_M.currentArea]) + gui.text(320, 80, "Rightmost: "..rightmost) displayButtons() formCtx:set() @@ -631,7 +636,7 @@ local function generateNetwork(genome) end local function elapsed(_M) - if config.StartPowerup ~= NIL then + if config.StartPowerup ~= nil then game.writePowerup(config.StartPowerup) end _M.currentFrame = 0 diff --git a/util.lua b/util.lua index d5367f5..a9aa3a0 100644 --- a/util.lua +++ b/util.lua @@ -1,5 +1,7 @@ local _M = {} +_M.isWin = package.config:sub(1, 1) == '\\' + function _M.table_to_string(tbl) local result = "{" local keys = {}