From ab179eb278410dd5328c51c351a67781af4962e3 Mon Sep 17 00:00:00 2001 From: Blur Date: Wed, 21 Aug 2024 20:01:45 -0500 Subject: [PATCH] Remove Mach's ring attraction --- src/Lua/Compatibility/C_Mach.lua | 20 ++++++++++++++++++++ src/init.lua | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/Lua/Compatibility/C_Mach.lua diff --git a/src/Lua/Compatibility/C_Mach.lua b/src/Lua/Compatibility/C_Mach.lua new file mode 100644 index 0000000..144a7aa --- /dev/null +++ b/src/Lua/Compatibility/C_Mach.lua @@ -0,0 +1,20 @@ +-- Mach, get a better modding environment. + +local oldMT = userdataMetatable("mobj_t") +local oldIndex = oldMT.__index + +oldMT.__index = function(mobj, field) + if field ~= "mach_ringAttract" + or not (skins["mach"] or GT_PTSPICER) then + return oldIndex(mobj, field) + else + if (mobj.type == MT_FLINGRING + or mobj.type == MT_FLINGCOIN) + and not mobj.fuse then + mobj.fuse = 12 + end + + mobj.target = nil + return false + end +end \ No newline at end of file diff --git a/src/init.lua b/src/init.lua index f026577..030d986 100644 --- a/src/init.lua +++ b/src/init.lua @@ -172,4 +172,5 @@ dofile "Exit Signs/exitsign_init.lua" dofile "Exit Signs/exitsign_thinkers.lua" dofile "Compatibility/C_Surge.lua" -dofile "Compatibility/C_Skip.lua" \ No newline at end of file +dofile "Compatibility/C_Skip.lua" +dofile "Compatibility/C_Mach.lua" \ No newline at end of file