Skip to content

Commit c3d098e

Browse files
Unload hooks on Unload
1 parent 56bfcfb commit c3d098e

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Code/FactoryHelperHooks.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ public static void Load() {
2020
On.Celeste.DashBlock.RemoveAndFlagAsGone += DashBlockRemoveAndFlagAsGone;
2121
}
2222

23+
public static void Unload() {
24+
On.Celeste.Player.ctor -= ctor;
25+
On.Celeste.Level.LoadLevel -= LoadLevel;
26+
On.Celeste.Player.Die -= PlayerDie;
27+
On.Celeste.LevelExit.Routine -= RespawnRoutine;
28+
On.Celeste.Player.Pickup -= Pickup;
29+
On.Celeste.Lookout.LookRoutine -= LookRoutine;
30+
On.Celeste.LevelEnter.Go -= LevelEnterGo;
31+
On.Celeste.DashBlock.Break_Vector2_Vector2_bool_bool -= DashBlockBreak;
32+
On.Celeste.DashBlock.RemoveAndFlagAsGone -= DashBlockRemoveAndFlagAsGone;
33+
}
34+
2335
private static void DashBlockRemoveAndFlagAsGone(On.Celeste.DashBlock.orig_RemoveAndFlagAsGone orig, DashBlock self) {
2436
if (self is FactoryActivatorDashBlock) {
2537
self.RemoveSelf();

Code/FactoryHelperModule.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public override void Load() {
2828
FactoryHelperHooks.Load();
2929
}
3030

31-
public override void Unload() { }
31+
public override void Unload() {
32+
FactoryHelperHooks.Unload();
33+
}
3234
}
3335
}

0 commit comments

Comments
 (0)