Skip to content

Instantly share code, notes, and snippets.

@himika
Last active January 5, 2016 13:06
Show Gist options
  • Save himika/96f6badbe4b01c5fe632 to your computer and use it in GitHub Desktop.
Save himika/96f6badbe4b01c5fe632 to your computer and use it in GitHub Desktop.
[TESV.exe] コンテナ初期化にフックをかけるサンプル
#include <SKSE/PluginAPI.h>
#include <SKSE/GameReferences.h>
#include <SKSE/GameObjects.h>
#include <SKSE/SafeWrite.h>
class InventoryChagesEx : public InventoryChanges
{
public:
void InitContainer_Hook()
{
// コンテナ初期化前
InitContainer();
// コンテナ初期化後
}
static void InitHook()
{
WriteRelCall(0x004839CB, &InitContainer_Hook);
WriteRelCall(0x00527714, &InitContainer_Hook);
}
};
class plugin_example : public SKSEPlugin
{
public:
// ...
virtual bool OnLoad() override
{
InventoryChangesEx::InitHook();
}
// ...
} thePlugin;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment