From 42a3c64e970c0002cee3cc73f0de92df5b1854b5 Mon Sep 17 00:00:00 2001 From: ineed bots Date: Wed, 19 Apr 2023 21:43:11 -0600 Subject: [PATCH] Fix no negotation link path generation --- src/component/test.cpp | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/component/test.cpp b/src/component/test.cpp index c9f1916..9868374 100644 --- a/src/component/test.cpp +++ b/src/component/test.cpp @@ -12,6 +12,43 @@ namespace test { game::dvar_s* custom_dvar; game::dvar_s* custom_string_dvar; + + bool our_funny_call(game::pathnode_t* begin_node, game::pathnode_t* end_node, bool allowNeg) + { + if (!allowNeg && begin_node->constant.type == game::NODE_NEGOTIATION_BEGIN && end_node->constant.type == game::NODE_NEGOTIATION_END) + { + return false; + } + + return true; + } + + void __declspec(naked) our_funny_hook() + { + __asm + { + pushad; + mov eax, [esp + 0x20 + 0x98 + 0x1C]; + push eax; + push esi; // end + push edi; // begin + call our_funny_call; + add esp, 0xC; + test al, al; + popad; + + jnz og; + + push 0x4D3400; + retn; + + og: + mov ecx, 0x18F78D4; + mov ecx, dword ptr [ecx]; // level.iSearchFrame + push 0x4D329C; + retn; + } + } } class component final : public component_interface @@ -44,7 +81,9 @@ namespace test //printf("Biggie Spam McCheese\n"); }); - + + // fix NEGOTIATION links + utils::hook::jump(0x4D3296, our_funny_hook); } private: