@@ -30,17 +30,19 @@ public static void Load() {
3030 // block "climb hopping" on top of sideways jumpthrus, because this just looks weird.
3131 On . Celeste . Player . ClimbHopBlockedCheck += onPlayerClimbHopBlockedCheck ;
3232
33- // mod collide checks to include sideways jumpthrus, so that the player behaves with them like with walls.
34- IL . Celeste . Player . WallJumpCheck += modCollideChecks ; // allow player to walljump off them
35- IL . Celeste . Player . ClimbCheck += modCollideChecks ; // allow player to climb on them
36- IL . Celeste . Player . ClimbBegin += modCollideChecks ; // if not applied, the player will clip through jumpthrus if trying to climb on them
37- IL . Celeste . Player . ClimbUpdate += modCollideChecks ; // when climbing, jumpthrus are handled like walls
38- IL . Celeste . Player . SlipCheck += modCollideChecks ; // make climbing on jumpthrus not slippery
39- IL . Celeste . Player . NormalUpdate += modCollideChecks ; // get the wall slide effect
40- IL . Celeste . Player . OnCollideH += modCollideChecks ; // handle dashes against jumpthrus properly, without "shifting" down
41-
42- // have the push animation when Madeline runs against a jumpthru for example
43- hookOnUpdateSprite = new ILHook ( typeof ( Player ) . GetMethod ( updateSpriteMethodToPatch , BindingFlags . NonPublic | BindingFlags . Instance ) , modCollideChecks ) ;
33+ using ( new DetourContext ( ) ) {
34+ // mod collide checks to include sideways jumpthrus, so that the player behaves with them like with walls.
35+ IL . Celeste . Player . WallJumpCheck += modCollideChecks ; // allow player to walljump off them
36+ IL . Celeste . Player . ClimbCheck += modCollideChecks ; // allow player to climb on them
37+ IL . Celeste . Player . ClimbBegin += modCollideChecks ; // if not applied, the player will clip through jumpthrus if trying to climb on them
38+ IL . Celeste . Player . ClimbUpdate += modCollideChecks ; // when climbing, jumpthrus are handled like walls
39+ IL . Celeste . Player . SlipCheck += modCollideChecks ; // make climbing on jumpthrus not slippery
40+ IL . Celeste . Player . NormalUpdate += modCollideChecks ; // get the wall slide effect
41+ IL . Celeste . Player . OnCollideH += modCollideChecks ; // handle dashes against jumpthrus properly, without "shifting" down
42+
43+ // have the push animation when Madeline runs against a jumpthru for example
44+ hookOnUpdateSprite = new ILHook ( typeof ( Player ) . GetMethod ( updateSpriteMethodToPatch , BindingFlags . NonPublic | BindingFlags . Instance ) , modCollideChecks ) ;
45+ }
4446
4547 // one extra hook that kills the player momentum when hitting a jumpthru so that they don't get "stuck" on them.
4648 On . Celeste . Player . NormalUpdate += onPlayerNormalUpdate ;
0 commit comments