Merge pull request #106 from mjkzy/gsc

fix infinite loop
This commit is contained in:
Maurice Heumann 2023-01-10 11:00:11 +01:00 committed by GitHub
commit d547aa6065
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,28 @@
#include <std_include.hpp>
#include "loader/component_loader.hpp"
#include "game/game.hpp"
#include <utils/hook.hpp>
namespace patches
{
namespace
{
void scr_are_textures_loaded_stub([[maybe_unused]] game::scriptInstance_t inst)
{
game::Scr_AddInt(game::SCRIPTINSTANCE_SERVER, 1);
}
}
struct component final : server_component
{
void post_unpack() override
{
// Fix infinite loop
utils::hook::jump(0x1402E86B0_g, scr_are_textures_loaded_stub);
}
};
}
REGISTER_COMPONENT(patches::component)

View File

@ -74,6 +74,7 @@ namespace game
};
// Scr
WEAK symbol<void(scriptInstance_t inst, int value)> Scr_AddInt{0x0, 0x14016F160};
WEAK symbol<void(scriptInstance_t inst, const char* value)> Scr_AddString{0x0, 0x14016F320};
WEAK symbol<const char* (scriptInstance_t inst, unsigned int index)> Scr_GetString{0x0, 0x140171490};
WEAK symbol<void(gentity_s* ent, ScrVarCanonicalName_t stringValue, unsigned int paramcount)> Scr_Notify_Canon{0x0, 0x1402F5FF0};