From 62f58b5b09c97b7a449695cd5d05676ea8d5d9d6 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 7 May 2017 19:04:57 +0200 Subject: [PATCH] [Script] Fix setExpFog hook --- src/Components/Modules/Script.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Components/Modules/Script.cpp b/src/Components/Modules/Script.cpp index 58c3101c..00795a35 100644 --- a/src/Components/Modules/Script.cpp +++ b/src/Components/Modules/Script.cpp @@ -234,14 +234,17 @@ namespace Components Game::VariableValue*& scr_stack = *reinterpret_cast(0x2040D00); if(scr_stack) { - Game::Scr_AddFloat(0); // Push transition time onto the stack - Game::VariableValue transitionTime; - std::memcpy(&transitionTime, scr_stack, sizeof Game::VariableValue); - std::memmove(&scr_stack[0], &scr_stack[1], sizeof(Game::VariableValue) * 6); - std::memcpy(&scr_stack[6], &transitionTime, sizeof Game::VariableValue); + std::memmove(&scr_stack[-4], &scr_stack[-5], sizeof(Game::VariableValue) * 6); + scr_stack += 1; + scr_stack[-6].type = Game::VAR_FLOAT; + scr_stack[-6].u.floatValue = 0; + + ++*reinterpret_cast(0x2040D0C); } } + MessageBoxA(0, Utils::String::VA("%d", Game::Scr_GetNumParam()), "ZOOB", 0); + return Game::Scr_GetNumParam(); }