Skip to content

Commit b6ab459

Browse files
authored
fix a bug with the function pointer
1 parent 6212f44 commit b6ab459

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/GameEventHandler.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,8 +2332,8 @@ namespace plugin {
23322332
if (auto func_ptr = (func_iter + i)) {
23332333
if (auto func = func_ptr->func) {
23342334
if (func->GetName() == RE::BSFixedString("QUpdateNormalmap") && func->GetIsNative()) {
2335-
qupdatenormalmap = (void (*)(void* arg1, RE::Actor* actor, int armor_slot_bit)) *
2336-
(uint64_t*) (((uint64_t) func.get()) + 0x50);
2335+
qupdatenormalmap = (void (*)(void* arg1, RE::Actor* actor, int armor_slot_bit))
2336+
( ((*(uint64_t*) func.get()) + 0x58));
23372337
logger::info("found QUpdateNormalMap");
23382338
}
23392339
}
@@ -2353,8 +2353,8 @@ namespace plugin {
23532353
if (auto func_ptr = (func_iter + i)) {
23542354
if (auto func = func_ptr->func) {
23552355
if (func->GetName() == RE::BSFixedString("SetSkin") && func->GetIsNative()) {
2356-
original_setskin = (void (*)(RE::TESActorBase* actorbase, RE::TESObjectARMO* skin)) *
2357-
(uint64_t*) (((uint64_t) func.get()) + 0x50);
2356+
original_setskin = (void (*)(RE::TESActorBase* actorbase, RE::TESObjectARMO* skin))(
2357+
((*(uint64_t*) func.get()) + 0x58));
23582358
logger::info("found SetSkin");
23592359
}
23602360
}

0 commit comments

Comments
 (0)