From 02a3394c2d95e1c3fc8ea32c75cf129ddcbd9a71 Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Sat, 7 Mar 2026 09:21:34 +0000 Subject: [PATCH] fix: fix extraction of source templating games --- tools/scripts/source_templating.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/scripts/source_templating.lua b/tools/scripts/source_templating.lua index db6b7264..71dd9028 100644 --- a/tools/scripts/source_templating.lua +++ b/tools/scripts/source_templating.lua @@ -12,19 +12,19 @@ function useSourceTemplating(projectName) local resultExtension = path.getextension(relativeResultPath) local data = io.readfile(templateFile) - local gameOptionsStart, gameOptionsCount = string.find(data, "#options%s+GAME%s*%(") + local gameOptionsStart, gameOptionsEnd = string.find(data, "#options%s+GAME%s*%(") if gameOptionsStart == nil then error("Source template " .. relativeTemplatePath .. " must define an option called GAME") end - local gameOptionsPos, gameOptionsLenPlusOne = string.find(data, "[%a%d%s,]+%)", gameOptionsStart + gameOptionsCount) + local gameOptionsArgsStart, gameOptionsArgsEnd = string.find(data, "[%a%d%s,]+%)", gameOptionsEnd + 1) - if gameOptionsPos ~= gameOptionsStart + gameOptionsCount then + if gameOptionsArgsStart ~= gameOptionsEnd + 1 then error("Source template " .. relativeTemplatePath .. " must define an option called GAME") end - local gameOptions = string.sub(data, gameOptionsPos, gameOptionsLenPlusOne - 1) + local gameOptions = string.sub(data, gameOptionsArgsStart, gameOptionsArgsEnd - 1) local games = string.explode(gameOptions, ",%s*") files {