Skip to content

Commit 7ad75ca

Browse files
committed
Prevent c1k's mod from deleting us
This is necessary because the way c1k's mod handles a newer version being installed alongside the one that is embedded is incompatible with the advice the error message the server provides upon a protocol mismatch. This is a problem because the error message is very general and is the preferred way to activate a version that is newer than the bundled one, so it should be correct for all mods. We can either choose to not support mods that don't conform, or conform to these mods ourselves...
1 parent c2a022b commit 7ad75ca

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tptmp/client/init.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@ local function run()
4545
return
4646
end
4747

48+
-- * Prevent c1k's mod from deleting us.
49+
if tpt.version.modid == 6 then
50+
local protect_from_malware = {
51+
[ "scripts/downloaded/2 LBPHacker-TPTMulti.lua" ] = true,
52+
[ "scripts/downloaded/219 Maticzpl-Notifications.lua" ] = true,
53+
}
54+
55+
local real_remove = os.remove
56+
function os.remove(path)
57+
if path and protect_from_malware[path] then
58+
return nil, "malware :/"
59+
end
60+
return real_remove(path)
61+
end
62+
end
63+
4864
local hooks_enabled = false
4965
local window_status = "hidden"
5066
local window_hide_mode = "hidden"

0 commit comments

Comments
 (0)