Skip to content

Commit

Permalink
Extend DetourContext to ensure Everest Core compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
maddie480 committed Aug 27, 2023
1 parent da57e53 commit a56445e
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions Entities/UpsideDownJumpThru.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit a56445e

Please sign in to comment.