[Script] Fix setExpFog hook

This commit is contained in:
momo5502 2017-05-07 19:04:57 +02:00
parent 32a6e53dbd
commit 62f58b5b09

View File

@ -234,14 +234,17 @@ namespace Components
Game::VariableValue*& scr_stack = *reinterpret_cast<Game::VariableValue**>(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<DWORD*>(0x2040D0C);
}
}
MessageBoxA(0, Utils::String::VA("%d", Game::Scr_GetNumParam()), "ZOOB", 0);
return Game::Scr_GetNumParam();
}