Merge pull request #452 from Brentdevent/bgb-script

Workaround out-of-gobblegums
This commit is contained in:
Maurice Heumann 2023-04-07 06:05:29 +02:00 committed by GitHub
commit d65c6ad96a
2 changed files with 9 additions and 1 deletions

View File

@ -13,6 +13,8 @@ namespace script
namespace
{
utils::hook::detour db_findxassetheader_hook;
utils::hook::detour gscr_get_bgb_remaining_hook;
std::unordered_map<std::string, game::RawFile*> loaded_scripts;
game::RawFile* get_loaded_script(const std::string& name)
@ -110,6 +112,11 @@ namespace script
return asset_header;
}
void gscr_get_bgb_remaining_stub(game::scriptInstance_t inst, void* entref)
{
game::Scr_AddInt(game::SCRIPTINSTANCE_SERVER, 255);
}
}
struct component final : generic_component
@ -126,6 +133,7 @@ namespace script
}
db_findxassetheader_hook.create(game::select(0x141420ED0, 0x1401D5FB0), db_findxassetheader_stub);
gscr_get_bgb_remaining_hook.create(game::select(0x141A8CAB0, 0x1402D2310), gscr_get_bgb_remaining_stub);
}
};
};

View File

@ -139,7 +139,7 @@ namespace game
WEAK symbol<void(int localClientNum)> CL_CheckKeepDrawingConnectScreen{0x1413CCAE0};
// Scr
WEAK symbol<void(scriptInstance_t inst, int value)> Scr_AddInt{0x0, 0x14016F160};
WEAK symbol<void(scriptInstance_t inst, int value)> Scr_AddInt{0x1412E9870, 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{