Skip to content

Commit 63f2235

Browse files
committed
Reimplement duplicate smods detection and crash screen
1 parent eead56e commit 63f2235

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/crash_handler.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,10 @@ function injectStackTrace()
672672
local err = {}
673673

674674
table.insert(err, "Oops! The game crashed:")
675-
if sanitizedmsg:find("Syntax error: game.lua:4: '=' expected near 'Game'") then
675+
676+
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.')
678+
elseif sanitizedmsg:find("Syntax error: game.lua:4: '=' expected near 'Game'") then
676679
table.insert(err,
677680
'Duplicate installation of Steamodded detected! Please clean your installation: Steam Library > Balatro > Properties > Installed Files > Verify integrity of game files.')
678681
elseif sanitizedmsg:find("Syntax error: game.lua:%d+: duplicate label 'continue'") then
@@ -693,8 +696,8 @@ function injectStackTrace()
693696
table.insert(err, '\n\nDevelopment version of Steamodded detected! If you are not actively developing a mod, please try using the latest release instead.\n\n')
694697
end
695698

696-
if not V then
697-
table.insert(err, '\nA mod you have installed has caused a syntax error through patching. Please share this crash with the mod developer.\n')
699+
if not V and not smods_dupe then
700+
table.insert(err, '\nA mod you have installed has caused a syntax error through patching. Please share this crash with the mod developer.\n')
698701
end
699702

700703
local success, msg = pcall(getDebugInfoForCrash)

src/preflight/loader.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ function loadMods(modsDirectory)
477477
name = name:match("^(.*).zip$")
478478
end
479479
local path = SMODS.MODS_DIR.. "/" .. flags.name .. "/"
480+
if flags.name:find('smods') then smods_dupe = true end
480481
local mod = {
481482
name = name,
482483
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-1502c-STEAMODDED"
1+
return "1.0.0~BETA-1502d-STEAMODDED"

0 commit comments

Comments
 (0)