mirror of
https://github.com/Jacobwasbeast/LegacyWeaveLoader.git
synced 2026-07-01 08:41:24 +00:00
fix(runtime): remap modded item ids using namespace tags
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "GameObjectFactory.h"
|
||||
#include "FurnaceRecipeRegistry.h"
|
||||
#include "NativeExports.h"
|
||||
#include "WorldIdRemap.h"
|
||||
#include "LogUtil.h"
|
||||
#include <MinHook.h>
|
||||
|
||||
@@ -19,6 +20,8 @@ bool HookManager::Install(const SymbolResolver& symbols)
|
||||
return false;
|
||||
}
|
||||
|
||||
WorldIdRemap::SetTagNewTagSymbol(symbols.pTagNewTag);
|
||||
|
||||
if (symbols.pRunStaticCtors)
|
||||
{
|
||||
if (MH_CreateHook(symbols.pRunStaticCtors,
|
||||
@@ -83,6 +86,34 @@ bool HookManager::Install(const SymbolResolver& symbols)
|
||||
}
|
||||
}
|
||||
|
||||
if (symbols.pItemInstanceSave)
|
||||
{
|
||||
if (MH_CreateHook(symbols.pItemInstanceSave,
|
||||
reinterpret_cast<void*>(&GameHooks::Hooked_ItemInstanceSave),
|
||||
reinterpret_cast<void**>(&GameHooks::Original_ItemInstanceSave)) != MH_OK)
|
||||
{
|
||||
LogUtil::Log("[WeaveLoader] Warning: Failed to hook ItemInstance::save");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogUtil::Log("[WeaveLoader] Hooked ItemInstance::save (namespace remap)");
|
||||
}
|
||||
}
|
||||
|
||||
if (symbols.pItemInstanceLoad)
|
||||
{
|
||||
if (MH_CreateHook(symbols.pItemInstanceLoad,
|
||||
reinterpret_cast<void*>(&GameHooks::Hooked_ItemInstanceLoad),
|
||||
reinterpret_cast<void**>(&GameHooks::Original_ItemInstanceLoad)) != MH_OK)
|
||||
{
|
||||
LogUtil::Log("[WeaveLoader] Warning: Failed to hook ItemInstance::load");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogUtil::Log("[WeaveLoader] Hooked ItemInstance::load (namespace remap)");
|
||||
}
|
||||
}
|
||||
|
||||
if (symbols.pItemInstanceGetIcon)
|
||||
{
|
||||
if (MH_CreateHook(symbols.pItemInstanceGetIcon,
|
||||
|
||||
Reference in New Issue
Block a user