Closed bdemmy closed 2 months ago
The hook structure looks quite unclean, if possible we prefer avoiding inline assembly with the help of GetParentBasePtr and prefer hooking calls directly (if thiscall is used __fastcall can be used to emulate it). If inline assembly is required we generally try to avoid pushad and popad. We also generally try not to mix inline assembly with C++. Example: https://github.com/xNVSE/NVSE/blob/a2852dd1f8a686d7506c44632559cc7b5d9726c5/nvse/nvse/Hooks_SaveLoad.cpp#L70 (feel free to checkout other usages of GetParentBasePtr, some good ones are in xNVSE, kNVSE and ShowOff xNVSE)
Edit: I previously had some thoughts this wouldn't register for script events but it actually does and I wasn't familiar with the EVENT_INFO macro.
Actually, the only message dispatched is to the plugin manager so it's probably missing the call to EventManager::DispatchEvent
as well if it should work in script events
This is all cleaned up now. Just going to convert to the other event system. Thanks again :)
Added some lockpick hooks (Lock broken, success, pick break).
Added terminal hack fail/success events. More to come.
Think these hooks are sufficient. Lmk if they are not.