mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Fix CEngineClient::GetLocalPlayer()
Use VFTable method by index instead.
This commit is contained in:
parent
81374e8682
commit
65f8784e6e
@ -55,9 +55,14 @@ bool CEngineClient::GetRestrictClientCommands() const
|
|||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
// Purpose: get local player
|
// Purpose: get local player
|
||||||
// Input :
|
// Input :
|
||||||
// Output : void* (C_Player)
|
// Output : int
|
||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
void* CEngineClient::GetLocalPlayer() const
|
int CEngineClient::GetLocalPlayer()
|
||||||
{
|
{
|
||||||
return CEngineClient_GetLocalPlayer();
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
||||||
|
const int index = 35;
|
||||||
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||||
|
const int index = 36;
|
||||||
|
#endif
|
||||||
|
return CallVFunc<int>(index, this);
|
||||||
}
|
}
|
@ -7,7 +7,7 @@ public:
|
|||||||
bool GetRestrictServerCommands() const;
|
bool GetRestrictServerCommands() const;
|
||||||
void SetRestrictClientCommands(bool bRestrict);
|
void SetRestrictClientCommands(bool bRestrict);
|
||||||
bool GetRestrictClientCommands() const;
|
bool GetRestrictClientCommands() const;
|
||||||
void* GetLocalPlayer() const; // Is actually C_Player.
|
int GetLocalPlayer(); // Local player index.
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ==== CVENGINECLIENT ================================================================================================================================================== */
|
/* ==== CVENGINECLIENT ================================================================================================================================================== */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user