Skip to content

Commit

Permalink
Fix message hook positions
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamepiaynmo committed Apr 4, 2021
1 parent a979d41 commit d4bcf11
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions BMLMod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,17 @@ void BMLMod::OnEditScript_Base_EventHandler(CKBehavior* script) {
InsertBB(script, FindNextLink(script, FindNextBB(script, som, nullptr, 1, 0)), CreateBB(script, BML_ONEXITGAME_GUID));

GetLogger()->Info("Insert message Load Level Hook");
InsertBB(script, FindNextLink(script, FindNextBB(script, som, nullptr, 2, 0)), CreateBB(script, BML_ONPRELOADLEVEL_GUID));
CKBehaviorLink* link = FindNextLink(script, FindNextBB(script, FindNextBB(script, FindNextBB(script, som, nullptr, 2, 0))));
InsertBB(script, link, CreateBB(script, BML_ONPRELOADLEVEL_GUID));
CreateLink(script, FindEndOfChain(script, FindNextBB(script, som, nullptr, 2, 0)), CreateBB(script, BML_ONPOSTLOADLEVEL_GUID));

GetLogger()->Info("Insert message Start Level Hook");
CreateLink(script, FindEndOfChain(script, FindNextBB(script, som, nullptr, 3, 0)), CreateBB(script, BML_ONSTARTLEVEL_GUID));

GetLogger()->Info("Insert message Reset Level Hook");
InsertBB(script, FindNextLink(script, FindNextBB(script, som, nullptr, 4, 0)), CreateBB(script, BML_ONPRERESETLEVEL_GUID));
CKBehavior* rl = FindFirstBB(script, "reset Level");
link = FindNextLink(rl, FindNextBB(rl, FindNextBB(rl, rl->GetInput(0))));
InsertBB(script, link, CreateBB(script, BML_ONPRERESETLEVEL_GUID));
CreateLink(script, FindEndOfChain(script, FindNextBB(script, som, nullptr, 4, 0)), CreateBB(script, BML_ONPOSTRESETLEVEL_GUID));

GetLogger()->Info("Insert message Pause Level Hook");
Expand All @@ -207,11 +210,15 @@ void BMLMod::OnEditScript_Base_EventHandler(CKBehavior* script) {
CKBehavior* bs = FindNextBB(script, FindFirstBB(script, "DeleteCollisionSurfaces"));

GetLogger()->Info("Insert message Exit Level Hook");
InsertBB(script, FindNextLink(script, FindNextBB(script, som, nullptr, 7, 0)), CreateBB(script, BML_ONPREEXITLEVEL_GUID));
link = FindNextLink(script, FindNextBB(script, FindNextBB(script,
FindNextBB(script, FindNextBB(script, FindNextBB(script, som, nullptr, 7, 0))))));
InsertBB(script, link, CreateBB(script, BML_ONPREEXITLEVEL_GUID));
InsertBB(script, FindNextLink(script, FindNextBB(script, bs, nullptr, 0, 0)), CreateBB(script, BML_ONPOSTEXITLEVEL_GUID));

GetLogger()->Info("Insert message Next Level Hook");
InsertBB(script, FindNextLink(script, FindNextBB(script, som, nullptr, 8, 0)), CreateBB(script, BML_ONPRENEXTLEVEL_GUID));
link = FindNextLink(script, FindNextBB(script, FindNextBB(script,
FindNextBB(script, FindNextBB(script, FindNextBB(script, som, nullptr, 8, 0))))));
InsertBB(script, link, CreateBB(script, BML_ONPRENEXTLEVEL_GUID));
InsertBB(script, FindNextLink(script, FindNextBB(script, bs, nullptr, 1, 0)), CreateBB(script, BML_ONPOSTNEXTLEVEL_GUID));

GetLogger()->Info("Insert message Dead Hook");
Expand Down
2 changes: 1 addition & 1 deletion BuildVer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define BML_MAJOR_VER 0
#define BML_MINOR_VER 3
#define BML_BUILD_VER 34
#define BML_BUILD_VER 35

0 comments on commit d4bcf11

Please sign in to comment.