diff --git a/artifacts/scripting/headers/define_extra.h b/artifacts/scripting/headers/define_extra.h index aaf893e5..d9375b32 100644 --- a/artifacts/scripting/headers/define_extra.h +++ b/artifacts/scripting/headers/define_extra.h @@ -146,7 +146,7 @@ //#define RMOBJ_AI_USE_DRUG_ON_2 4360176 // same as RMOBJ_AI_USE_DRUG_ON (obsolete, use only for sfall before 4.3.1/3.8.31) #define RMOBJ_BARTER_ARMOR 4675656 // removing armor from NPC's slot before entering the barter screen #define RMOBJ_BARTER_WEAPON 4675722 // removing weapon from NPC's slot before entering the barter screen -#define RMOBJ_INVEN_DROP_CAPS 4667295 // if money/caps are dropped manually by the player from the inventory screen +#define RMOBJ_INVEN_DROP_CAPS 4667295 // if multiple money/caps are dropped manually by the player from the inventory screen #define RMOBJ_DROP_INTO_CONTAINER 4678833 // when dropping items into a container item (bag/backpack) // old defines #define RMOBJ_RM_MULT_OBJS RMOBJ_ITEM_REMOVED_MULTI diff --git a/sfall/Modules/HookScripts/MiscHs.cpp b/sfall/Modules/HookScripts/MiscHs.cpp index dc8dfd27..e30c618f 100644 --- a/sfall/Modules/HookScripts/MiscHs.cpp +++ b/sfall/Modules/HookScripts/MiscHs.cpp @@ -373,7 +373,7 @@ static void CarTravelHook_Script() { consumption = static_cast(rets[1]); } // consume fuel - fo::var::carGasAmount = max(originalGas - consumption, 0); + fo::var::carGasAmount = max(0, originalGas - consumption); EndHook(); } @@ -457,9 +457,9 @@ static long __fastcall RestTimerHook_Script(DWORD hours, DWORD minutes, DWORD ga static void __declspec(naked) RestTimerLoopHook() { __asm { pushadc; - mov edx, [esp + 20 + 0x44]; // minutes_ - mov ecx, [esp + 20 + 0x40]; // hours_ - push [esp + 16]; // addrHook + mov edx, [esp + 16 + 0x44]; // minutes_ + mov ecx, [esp + 16 + 0x40]; // hours_ + push [esp + 12]; // addrHook push eax; // gameTime call RestTimerHook_Script; pop ecx; @@ -477,9 +477,9 @@ static void __declspec(naked) RestTimerEscapeHook() { cmp eax, 0x1B; // ESC ASCII code jnz skip; pushadc; - mov edx, [esp + 20 + 0x44]; // minutes_ - mov ecx, [esp + 20 + 0x40]; // hours_ - push [esp + 16]; // addrHook + mov edx, [esp + 16 + 0x44]; // minutes_ + mov ecx, [esp + 16 + 0x40]; // hours_ + push [esp + 12]; // addrHook push eax; // gameTime call RestTimerHook_Script; pop ecx; @@ -717,7 +717,7 @@ void Inject_WithinPerceptionHook() { void Inject_CarTravelHook() { MakeJump(0x4BFEF1, CarTravelHack); - BlockCall(0x4BFF6E); // vanilla wnCarUseGas(100) call + BlockCall(0x4BFF6E); // vanilla wmCarUseGas(100) call } void Inject_SetGlobalVarHook() { diff --git a/sfall/Modules/Karma.h b/sfall/Modules/Karma.h index 4be555dc..d13fafcf 100644 --- a/sfall/Modules/Karma.h +++ b/sfall/Modules/Karma.h @@ -26,8 +26,9 @@ namespace sfall class Karma : public Module { public: const char* name() { return "Karma"; } - static void DisplayKarma(int value); void init(); + + static void DisplayKarma(int value); }; extern bool displayKarmaChanges;