Skip to content

Commit 903f812

Browse files
author
G_Moris
committed
Test fix game_sa
1 parent 7a11241 commit 903f812

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

Client/game_sa/CFileLoaderSA.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ CEntitySAInterface* CFileLoaderSA::LoadObjectInstance(SFileObjectInstance* obj)
3737
class CAtomicModelInfo
3838
{
3939
public:
40-
void CAtomicModelInfo::DeleteRwObject() { ((void(__thiscall*)(CAtomicModelInfo*))(*(void***)this)[8])(this); }
40+
void DeleteRwObject() { ((void(__thiscall*)(CAtomicModelInfo*))(*(void***)this)[8])(this); }
4141

42-
void CAtomicModelInfo::SetAtomic(RpAtomic* atomic) { ((void(__thiscall*)(CAtomicModelInfo*, RpAtomic*))(*(void***)this)[15])(this, atomic); }
42+
void SetAtomic(RpAtomic* atomic) { ((void(__thiscall*)(CAtomicModelInfo*, RpAtomic*))(*(void***)this)[15])(this, atomic); }
4343
};
4444

4545
class CDamagableModelInfo
4646
{
4747
public:
48-
void CDamagableModelInfo::SetDamagedAtomic(RpAtomic* atomic) { ((void(__thiscall*)(CDamagableModelInfo*, RpAtomic*))0x4C48D0)(this, atomic); }
48+
void SetDamagedAtomic(RpAtomic* atomic) { ((void(__thiscall*)(CDamagableModelInfo*, RpAtomic*))0x4C48D0)(this, atomic); }
4949
};
5050

5151
static char* GetFrameNodeName(RwFrame* frame)

Client/game_sa/CWorldSA.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,14 @@ void CWorldSA::InstallHooks()
8989
DWORD CONTINUE_CWorld_FallenPeds = 0x00565CBA;
9090
DWORD CONTINUE_CWorld_FallenCars = 0x00565E8A;
9191

92+
bool IsUnderWorldWarpEnabled()
93+
{
94+
return pGame && pGame->IsUnderWorldWarpEnabled();
95+
}
96+
9297
void _declspec(naked) HOOK_FallenPeds()
9398
{
94-
if (pGame && pGame->IsUnderWorldWarpEnabled())
99+
if (IsUnderWorldWarpEnabled())
95100
{
96101
_asm
97102
{
@@ -112,7 +117,7 @@ void _declspec(naked) HOOK_FallenPeds()
112117

113118
void _declspec(naked) HOOK_FallenCars()
114119
{
115-
if (pGame && pGame->IsUnderWorldWarpEnabled())
120+
if (IsUnderWorldWarpEnabled())
116121
{
117122
_asm
118123
{

Client/game_sa/HookSystem.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#pragma once
1313

14+
#include "gamesa_init.h"
15+
1416
#define MAX_JUMPCODE_SIZE 20
1517

1618
template <typename T>
@@ -24,6 +26,8 @@ void* FunctionPointerToVoidP(T func)
2426
return c.b;
2527
}
2628

29+
BYTE* CreateJump(DWORD dwFrom, DWORD dwTo, BYTE* ByteArray);
30+
2731
template <typename T>
2832
bool HookInstall(DWORD dwInstallAddress, T dwHookHandler, int iJmpCodeSize = 5)
2933
{
@@ -40,8 +44,6 @@ bool HookInstall(DWORD dwInstallAddress, T dwHookHandler, int iJmpCodeSize = 5)
4044
}
4145
}
4246

43-
BYTE* CreateJump(DWORD dwFrom, DWORD dwTo, BYTE* ByteArray);
44-
4547
// Auto detect requirement of US/EU hook installation
4648
#define EZHookInstall(type) \
4749
HookInstall(HOOKPOS_##type, (DWORD)HOOK_##type, HOOKSIZE_##type);

Client/game_sa/premake5.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ project "Game SA"
66

77
-- HACK(Jusonex): Temp fix for ebp not being set in naked functions
88
-- More information on this in multiplayer_sa's premake5.lua
9-
cppdialect "C++14"
9+
cppdialect "C++20"
1010

1111
pchheader "StdInc.h"
1212
pchsource "StdInc.cpp"

0 commit comments

Comments
 (0)