Skip to content

Commit 641e627

Browse files
committed
Improve duplicate install detection and error message
1 parent e5abf83 commit 641e627

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

lovely/crash_handler.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[manifest]
22
version = "1.0.0"
33
dump_lua = true
4-
priority = -10
4+
priority = -11
55

66
[[patches]]
77
[patches.pattern]

src/crash_handler.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -671,10 +671,10 @@ function injectStackTrace()
671671

672672
local err = {}
673673

674-
table.insert(err, "Oops! The game crashed:")
674+
if not smods_dupe then table.insert(err, "Oops! The game crashed:") end
675675

676676
if smods_dupe then
677-
table.insert(err, 'Duplicate installation of Steamodded detected! Please remove the duplicate steamodded/smods folder/zip in your mods folder.')
677+
table.insert(err, 'Duplicate installation of Steamodded detected! \n\nPlease remove the duplicate steamodded/smods folder/zip in your mods folder.\n\nPossible location: ' .. smods_dupe)
678678
elseif sanitizedmsg:find("Syntax error: game.lua:4: '=' expected near 'Game'") then
679679
table.insert(err,
680680
'Duplicate installation of Steamodded detected! Please clean your installation: Steam Library > Balatro > Properties > Installed Files > Verify integrity of game files.')
@@ -701,7 +701,9 @@ function injectStackTrace()
701701
end
702702

703703
local success, msg = pcall(getDebugInfoForCrash)
704-
if success and msg then
704+
if smods_dupe then
705+
trace = ''
706+
elseif success and msg then
705707
table.insert(err, '\n' .. msg)
706708
sendInfoMessage(msg, 'StackTrace')
707709
else

src/preflight/loader.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ function loadMods(modsDirectory)
289289
elseif filename:lower():match('%.json') and depth > 1 then
290290
local json_str = NFS.read(file_path)
291291
local parsed, mod = pcall(JSON.decode, json_str)
292+
if mod and mod.name and mod.name:find('Steamodded') then smods_dupe = directory end
292293
local valid = true
293294
local err
294295
if not parsed then
@@ -477,7 +478,6 @@ function loadMods(modsDirectory)
477478
name = name:match("^(.*).zip$")
478479
end
479480
local path = SMODS.MODS_DIR.. "/" .. flags.name .. "/"
480-
if flags.name:find('smods') then smods_dupe = true end
481481
local mod = {
482482
name = name,
483483
id = "lovely-compat-" .. flags.name,

version.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
return "1.0.0~BETA-1504a-STEAMODDED"
1+
return "1.0.0~BETA-1504b-STEAMODDED"

0 commit comments

Comments
 (0)