From 06c577947566cebf3677cf8b1306d6da372e8714 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Fri, 8 May 2026 14:40:42 +0800 Subject: [PATCH] Code edits to ApplyInvenApCostPatch --- sfall/Modules/Inventory.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sfall/Modules/Inventory.cpp b/sfall/Modules/Inventory.cpp index b32351ea..1351beb2 100644 --- a/sfall/Modules/Inventory.cpp +++ b/sfall/Modules/Inventory.cpp @@ -823,17 +823,16 @@ static int invenApCost, invenApCostDef; static char invenApQPReduction; static __declspec(naked) void inven_ap_cost_hack() { - static const DWORD inven_ap_cost_Ret = 0x46E812; __asm { - mul byte ptr invenApQPReduction; - mov edx, invenApCost; - jmp inven_ap_cost_Ret; + mul byte ptr invenApQPReduction; + mov edx, invenApCost; + retn; } } static bool onlyOnceAP = false; inline static void ApplyInvenApCostPatch() { - MakeJump(0x46E80B, inven_ap_cost_hack); + MakeCall(0x46E80B, inven_ap_cost_hack, 2); onlyOnceAP = true; }