Fixed args for HOOK_RESTTIMER

This commit is contained in:
NovaRain
2022-11-26 09:58:13 +08:00
parent 8521c1772b
commit 9ecd598544
3 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -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_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_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_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) #define RMOBJ_DROP_INTO_CONTAINER 4678833 // when dropping items into a container item (bag/backpack)
// old defines // old defines
#define RMOBJ_RM_MULT_OBJS RMOBJ_ITEM_REMOVED_MULTI #define RMOBJ_RM_MULT_OBJS RMOBJ_ITEM_REMOVED_MULTI
+8 -8
View File
@@ -373,7 +373,7 @@ static void CarTravelHook_Script() {
consumption = static_cast<long>(rets[1]); consumption = static_cast<long>(rets[1]);
} }
// consume fuel // consume fuel
fo::var::carGasAmount = max(originalGas - consumption, 0); fo::var::carGasAmount = max(0, originalGas - consumption);
EndHook(); EndHook();
} }
@@ -457,9 +457,9 @@ static long __fastcall RestTimerHook_Script(DWORD hours, DWORD minutes, DWORD ga
static void __declspec(naked) RestTimerLoopHook() { static void __declspec(naked) RestTimerLoopHook() {
__asm { __asm {
pushadc; pushadc;
mov edx, [esp + 20 + 0x44]; // minutes_ mov edx, [esp + 16 + 0x44]; // minutes_
mov ecx, [esp + 20 + 0x40]; // hours_ mov ecx, [esp + 16 + 0x40]; // hours_
push [esp + 16]; // addrHook push [esp + 12]; // addrHook
push eax; // gameTime push eax; // gameTime
call RestTimerHook_Script; call RestTimerHook_Script;
pop ecx; pop ecx;
@@ -477,9 +477,9 @@ static void __declspec(naked) RestTimerEscapeHook() {
cmp eax, 0x1B; // ESC ASCII code cmp eax, 0x1B; // ESC ASCII code
jnz skip; jnz skip;
pushadc; pushadc;
mov edx, [esp + 20 + 0x44]; // minutes_ mov edx, [esp + 16 + 0x44]; // minutes_
mov ecx, [esp + 20 + 0x40]; // hours_ mov ecx, [esp + 16 + 0x40]; // hours_
push [esp + 16]; // addrHook push [esp + 12]; // addrHook
push eax; // gameTime push eax; // gameTime
call RestTimerHook_Script; call RestTimerHook_Script;
pop ecx; pop ecx;
@@ -717,7 +717,7 @@ void Inject_WithinPerceptionHook() {
void Inject_CarTravelHook() { void Inject_CarTravelHook() {
MakeJump(0x4BFEF1, CarTravelHack); MakeJump(0x4BFEF1, CarTravelHack);
BlockCall(0x4BFF6E); // vanilla wnCarUseGas(100) call BlockCall(0x4BFF6E); // vanilla wmCarUseGas(100) call
} }
void Inject_SetGlobalVarHook() { void Inject_SetGlobalVarHook() {
+2 -1
View File
@@ -26,8 +26,9 @@ namespace sfall
class Karma : public Module { class Karma : public Module {
public: public:
const char* name() { return "Karma"; } const char* name() { return "Karma"; }
static void DisplayKarma(int value);
void init(); void init();
static void DisplayKarma(int value);
}; };
extern bool displayKarmaChanges; extern bool displayKarmaChanges;