From c5195b498314523b25d3c3c8727346cd8e8cbbed Mon Sep 17 00:00:00 2001 From: ineed bots Date: Mon, 18 Sep 2023 00:52:18 -0600 Subject: [PATCH] Fix --- .../decomp/clientscript/re_cscr_animtree.cpp | 2 +- .../decomp/clientscript/re_cscr_yacc.cpp | 10 +++++----- src/game/clientscript/cscr_yacc.hpp | 20 +++++++++---------- src/game/game.hpp | 1 + 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/component/decomp/clientscript/re_cscr_animtree.cpp b/src/component/decomp/clientscript/re_cscr_animtree.cpp index b38e05d..7fd15cd 100644 --- a/src/component/decomp/clientscript/re_cscr_animtree.cpp +++ b/src/component/decomp/clientscript/re_cscr_animtree.cpp @@ -3,7 +3,7 @@ #include "utils/hook.hpp" //#include "codsrc/clientscript/cscr_animtree.hpp" -#ifndef DISABLE_RE_CSCR_YACC +#ifndef DISABLE_RE_CSCR_ANIMTREE namespace re_cscr_animtree { utils::hook::detour AnimTreeCompileError_hook; diff --git a/src/component/decomp/clientscript/re_cscr_yacc.cpp b/src/component/decomp/clientscript/re_cscr_yacc.cpp index 60bae00..e42a79c 100644 --- a/src/component/decomp/clientscript/re_cscr_yacc.cpp +++ b/src/component/decomp/clientscript/re_cscr_yacc.cpp @@ -199,17 +199,17 @@ namespace re_cscr_yacc public: void post_unpack() override { - LowerCase_hook.create(game::LowerCase(), LowerCase_stub); + LowerCase_hook.create(game::LowerCase_ADDR(), LowerCase_stub); yyparse_hook.create(game::yyparse.get(), yyparse_stub); - StringValue_hook.create(game::StringValue(), StringValue_stub); + StringValue_hook.create(game::StringValue_ADDR(), StringValue_stub); yylex_hook.create(game::yylex.get(), yylex_stub); yy_get_next_buffer_hook.create(game::yy_get_next_buffer.get(), yy_get_next_buffer_stub); yy_get_previous_state_hook.create(game::yy_get_previous_state.get(), yy_get_previous_state_stub); - yy_try_NUL_trans_hook.create(game::yy_try_NUL_trans(), yy_try_NUL_trans_stub); + yy_try_NUL_trans_hook.create(game::yy_try_NUL_trans_ADDR(), yy_try_NUL_trans_stub); yyrestart_hook.create(game::yyrestart.get(), yyrestart_stub); yy_create_buffer_hook.create(game::yy_create_buffer.get(), yy_create_buffer_stub); - yy_flush_buffer_hook.create(game::yy_flush_buffer(), yy_flush_buffer_stub); - ScriptParse_hook.create(game::ScriptParse(), ScriptParse_stub); + yy_flush_buffer_hook.create(game::yy_flush_buffer_ADDR(), yy_flush_buffer_stub); + ScriptParse_hook.create(game::ScriptParse_ADDR(), ScriptParse_stub); //Original hook function addresses LowerCase_original = LowerCase_hook.get_original(); diff --git a/src/game/clientscript/cscr_yacc.hpp b/src/game/clientscript/cscr_yacc.hpp index 5b06a94..24df516 100644 --- a/src/game/clientscript/cscr_yacc.hpp +++ b/src/game/clientscript/cscr_yacc.hpp @@ -9,16 +9,16 @@ namespace game WEAK symbolyyrestart{ 0x0, 0x69D5C0 }; WEAK symbolyy_create_buffer{ 0x0, 0x69D620 }; - inline void* LowerCase() { return CALL_ADDR(0x0, 0x69AEA0); } - unsigned int LowerCase(unsigned int strVal, void* call_addr = LowerCase()); - inline void* StringValue() { return CALL_ADDR(0x0, 0x69BFF0); } - int StringValue(int len, const char* str_, void* call_addr = StringValue()); - inline void* yy_try_NUL_trans() { return CALL_ADDR(0x0, 0x69D520); } - int yy_try_NUL_trans(int yy_current_state, void* call_addr = yy_try_NUL_trans()); - inline void* yy_flush_buffer() { return CALL_ADDR(0x0, 0x69D690); } - void yy_flush_buffer(yy_buffer_state* result, void* call_addr = yy_flush_buffer()); - inline void* ScriptParse() { return CALL_ADDR(0x0, 0x69D710); } - void ScriptParse(scriptInstance_t a1, sval_u* parseData, void* call_addr = ScriptParse()); + inline void* LowerCase_ADDR() { return CALL_ADDR(0x0, 0x69AEA0); } + unsigned int LowerCase(unsigned int strVal, void* call_addr = LowerCase_ADDR()); + inline void* StringValue_ADDR() { return CALL_ADDR(0x0, 0x69BFF0); } + int StringValue(int len, const char* str_, void* call_addr = StringValue_ADDR()); + inline void* yy_try_NUL_trans_ADDR() { return CALL_ADDR(0x0, 0x69D520); } + int yy_try_NUL_trans(int yy_current_state, void* call_addr = yy_try_NUL_trans_ADDR()); + inline void* yy_flush_buffer_ADDR() { return CALL_ADDR(0x0, 0x69D690); } + void yy_flush_buffer(yy_buffer_state* result, void* call_addr = yy_flush_buffer_ADDR()); + inline void* ScriptParse_ADDR() { return CALL_ADDR(0x0, 0x69D710); } + void ScriptParse(scriptInstance_t a1, sval_u* parseData, void* call_addr = ScriptParse_ADDR()); FILE* yy_load_buffer_state(); void yy_fatal_error(const char* err); diff --git a/src/game/game.hpp b/src/game/game.hpp index 90f6c60..df989d3 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -41,6 +41,7 @@ //#define DISABLE_RE_CSCR_PARSETREE //#define DISABLE_RE_CSCR_READWRITE //#define DISABLE_RE_CSCR_STRINGLIST +//#define DISABLE_RE_CSCR_VARIABLE //#define DISABLE_RE_CSCR_VM //#define DISABLE_RE_CSCR_YACC