From a56445e612fb66a5ac1cf4575d3206c29a81267a Mon Sep 17 00:00:00 2001 From: maddie480 <52103563+maddie480@users.noreply.github.com> Date: Sun, 27 Aug 2023 14:28:24 +0200 Subject: [PATCH] Extend DetourContext to ensure Everest Core compatibility --- Entities/UpsideDownJumpThru.cs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Entities/UpsideDownJumpThru.cs b/Entities/UpsideDownJumpThru.cs index 0432959..103c711 100644 --- a/Entities/UpsideDownJumpThru.cs +++ b/Entities/UpsideDownJumpThru.cs @@ -70,20 +70,19 @@ public static void activateHooks() { using (new DetourContext { After = { "*" } }) { // fix player specific behavior allowing them to go through upside-down jumpthrus. On.Celeste.Player.ctor += onPlayerConstructor; - } - - // block player if they try to climb past an upside-down jumpthru. - IL.Celeste.Player.ClimbUpdate += patchPlayerClimbUpdate; + // block player if they try to climb past an upside-down jumpthru. + IL.Celeste.Player.ClimbUpdate += patchPlayerClimbUpdate; - // ignore upside-down jumpthrus in select places. - playerOrigUpdateHook = new ILHook(typeof(Player).GetMethod("orig_Update"), filterOutJumpThrusFromCollideChecks); - IL.Celeste.Player.DashUpdate += filterOutJumpThrusFromCollideChecks; - IL.Celeste.Player.RedDashUpdate += filterOutJumpThrusFromCollideChecks; - IL.Celeste.Actor.MoveVExact += filterOutJumpThrusFromCollideChecks; + // ignore upside-down jumpthrus in select places. + playerOrigUpdateHook = new ILHook(typeof(Player).GetMethod("orig_Update"), filterOutJumpThrusFromCollideChecks); + IL.Celeste.Player.DashUpdate += filterOutJumpThrusFromCollideChecks; + IL.Celeste.Player.RedDashUpdate += filterOutJumpThrusFromCollideChecks; + IL.Celeste.Actor.MoveVExact += filterOutJumpThrusFromCollideChecks; - // listen for the player unducking, to knock the player down before they would go through upside down jumpthrus. - On.Celeste.Player.Update += onPlayerUpdate; + // listen for the player unducking, to knock the player down before they would go through upside down jumpthrus. + On.Celeste.Player.Update += onPlayerUpdate; + } } public static void deactivateHooks() {