diff --git a/r5dev/codecs/bink/bink_impl.h b/r5dev/codecs/bink/bink_impl.h index aee6152a..f122d494 100644 --- a/r5dev/codecs/bink/bink_impl.h +++ b/r5dev/codecs/bink/bink_impl.h @@ -7,7 +7,7 @@ inline CMemory p_BinkClose; inline void(*v_BinkClose)(HANDLE hBinkFile); inline CMemory p_BinkGetError; -inline auto v_BinkGetError = p_BinkGetError.RCast(); +inline const char*(*v_BinkGetError)(void); /////////////////////////////////////////////////////////////////////////////// class BinkCore : public IDetour diff --git a/r5dev/common/completion.h b/r5dev/common/completion.h index a762f81a..66683236 100644 --- a/r5dev/common/completion.h +++ b/r5dev/common/completion.h @@ -14,8 +14,8 @@ int RTech_PakUnload_f_CompletionFunc(char const* partial, char commands[COMMAND_ int RTech_PakDecompress_f_CompletionFunc(char const* partial, char commands[COMMAND_COMPLETION_MAXITEMS][COMMAND_COMPLETION_ITEM_LENGTH]); inline CMemory p_CBaseAutoCompleteFileList_AutoCompletionFunc; -inline auto v_CBaseAutoCompleteFileList_AutoCompletionFunc = p_CBaseAutoCompleteFileList_AutoCompletionFunc.RCast(); +inline int(*v_CBaseAutoCompleteFileList_AutoCompletionFunc) +(CBaseAutoCompleteFileList* thisp, const char* partial, char commands[COMMAND_COMPLETION_MAXITEMS][COMMAND_COMPLETION_ITEM_LENGTH]); /////////////////////////////////////////////////////////////////////////////// class VCompletion : public IDetour diff --git a/r5dev/common/netmessages.h b/r5dev/common/netmessages.h index 7932baf8..31e3a49f 100644 --- a/r5dev/common/netmessages.h +++ b/r5dev/common/netmessages.h @@ -32,13 +32,13 @@ class Base_CmdKeyValues; //------------------------------------------------------------------------- // SVC_Print //------------------------------------------------------------------------- -inline auto SVC_Print_Process = CMemory().RCast(); +inline bool(*SVC_Print_Process)(SVC_Print* thisptr); inline void* g_pSVC_Print_VFTable = nullptr; //------------------------------------------------------------------------- // SVC_UserMessage //------------------------------------------------------------------------- -inline auto SVC_UserMessage_Process = CMemory().RCast(); +inline bool(*SVC_UserMessage_Process)(SVC_UserMessage* thisptr); inline void* g_pSVC_UserMessage_VFTable = nullptr; //------------------------------------------------------------------------- @@ -59,8 +59,8 @@ inline void* g_pCLC_ClientTick_VFTable = nullptr; //------------------------------------------------------------------------- // Base_CmdKeyValues //------------------------------------------------------------------------- -inline auto Base_CmdKeyValues_ReadFromBuffer = CMemory().RCast(); -inline auto Base_CmdKeyValues_WriteToBuffer = CMemory().RCast(); +inline bool(*Base_CmdKeyValues_ReadFromBuffer)(Base_CmdKeyValues* thisptr, bf_read* buffer); +inline bool(*Base_CmdKeyValues_WriteToBuffer)(Base_CmdKeyValues* thisptr, bf_write* buffer); inline void* g_pBase_CmdKeyValues_VFTable = nullptr; //------------------------------------------------------------------------- diff --git a/r5dev/engine/cmodel_bsp.h b/r5dev/engine/cmodel_bsp.h index 8d22e74c..fb94a996 100644 --- a/r5dev/engine/cmodel_bsp.h +++ b/r5dev/engine/cmodel_bsp.h @@ -22,8 +22,8 @@ inline void** unk_1418749B0; inline void** unk_141874550; inline int64_t* qword_167ED7BC0; -inline auto sub_14045BAC0 = p_Mod_ProcessPakQueue.RCast<__int64(*)(__int64(__fastcall* a1)(__int64, _DWORD*, __int64, _QWORD*), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4)>(); -inline auto sub_14045A1D0 = p_Mod_ProcessPakQueue.RCast<__int64(*)(unsigned __int8(__fastcall* a1)(_QWORD), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4, volatile signed __int64* a5, char a6)>(); +inline __int64(*sub_14045BAC0)(__int64(__fastcall* a1)(__int64, _DWORD*, __int64, _QWORD*), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4); +inline __int64(*sub_14045A1D0)(unsigned __int8(__fastcall* a1)(_QWORD), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4, volatile signed __int64* a5, char a6); inline void(*sub_140441220)(__int64 a1, __int64 a2); extern bool s_bBasePaksInitialized; diff --git a/r5dev/engine/host_cmd.h b/r5dev/engine/host_cmd.h index fccd4cea..aafdce52 100644 --- a/r5dev/engine/host_cmd.h +++ b/r5dev/engine/host_cmd.h @@ -34,7 +34,7 @@ inline CMemory p_Host_ChangeLevel; inline bool(*v_Host_ChangeLevel)(bool bLoadFromSavedGame, const char* pszMapName, const char* pszMapGroup); inline CMemory p_Host_Status_PrintClient; -inline auto v_Host_Status_PrintClient = p_Host_Status_PrintClient.RCast(); +inline void (*v_Host_Status_PrintClient)(CClient* client, bool bShowAddress, void (*print) (const char* fmt, ...)); inline CMemory p_SetLaunchOptions; inline int(*v_SetLaunchOptions)(const CCommand& args); diff --git a/r5dev/engine/modelloader.h b/r5dev/engine/modelloader.h index 1357a51a..dec12e0c 100644 --- a/r5dev/engine/modelloader.h +++ b/r5dev/engine/modelloader.h @@ -90,13 +90,13 @@ inline CMemory p_CModelLoader__Map_IsValid; inline bool(*CModelLoader__Map_IsValid)(CModelLoader* loader, const char* pszMapName); inline CMemory p_CMapLoadHelper__CMapLoadHelper; -inline auto CMapLoadHelper__CMapLoadHelper = p_CMapLoadHelper__CMapLoadHelper.RCast(); +inline void(*CMapLoadHelper__CMapLoadHelper)(CMapLoadHelper * helper, int lumpToLoad); inline CMemory p_AddGameLump; -inline auto v_AddGameLump = p_AddGameLump.RCast(); +inline void(*v_AddGameLump)(void); inline CMemory p_Map_LoadModel; -inline auto v_Map_LoadModel = p_Map_LoadModel.RCast(); +inline void(*v_Map_LoadModel)(void); //inline CMemory p_GetSpriteInfo; // DEDICATED PATCH! //inline void*(*GetSpriteInfo)(const char* pName, bool bIsAVI, bool bIsBIK, int& nWidth, int& nHeight, int& nFrameCount, void* a7); @@ -162,9 +162,9 @@ class VModelLoader : public IDetour CModelLoader__Map_LoadModelGuts = p_CModelLoader__Map_LoadModelGuts.RCast(); CModelLoader__Map_IsValid = p_CModelLoader__Map_IsValid.RCast(); - CMapLoadHelper__CMapLoadHelper = p_CMapLoadHelper__CMapLoadHelper.RCast(); - v_AddGameLump = p_AddGameLump.RCast(); - v_Map_LoadModel = p_Map_LoadModel.RCast(); + CMapLoadHelper__CMapLoadHelper = p_CMapLoadHelper__CMapLoadHelper.RCast(); + v_AddGameLump = p_AddGameLump.RCast(); + v_Map_LoadModel = p_Map_LoadModel.RCast(); //GetSpriteInfo = p_GetSpriteInfo.RCast(); //BuildSpriteLoadName = p_BuildSpriteLoadName.RCast(); diff --git a/r5dev/engine/networkstringtable.h b/r5dev/engine/networkstringtable.h index cde96d2b..6dc26128 100644 --- a/r5dev/engine/networkstringtable.h +++ b/r5dev/engine/networkstringtable.h @@ -55,8 +55,7 @@ private: }; inline CMemory p_CNetworkStringTableContainer__WriteUpdateMessage; -inline auto v_CNetworkStringTableContainer__WriteUpdateMessage = - p_CNetworkStringTableContainer__WriteUpdateMessage.RCast(); +inline void (*v_CNetworkStringTableContainer__WriteUpdateMessage)(CNetworkStringTableContainer* thisp, CClient* client, unsigned int tick_ack, bf_write* msg); class VNetworkStringTableContainer : public IDetour { diff --git a/r5dev/engine/server/datablock_sender.h b/r5dev/engine/server/datablock_sender.h index ed973df8..c6bab5be 100644 --- a/r5dev/engine/server/datablock_sender.h +++ b/r5dev/engine/server/datablock_sender.h @@ -56,8 +56,8 @@ inline CMemory p_ServerDataBlockSender__Destructor; inline void*(*v_ServerDataBlockSender__Destructor)(ServerDataBlockSender* thisptr); inline CMemory p_ServerDataBlockSender__SendDataBlock; -inline auto v_ServerDataBlockSender__SendDataBlock = p_ServerDataBlockSender__SendDataBlock.RCast(); +inline void* (*v_ServerDataBlockSender__SendDataBlock)(ServerDataBlockSender* thisptr, + short unk0, int unk1, short unk2, short unk3, const void* buffer, int length); /////////////////////////////////////////////////////////////////////////////// class VServerDataBlockSender : public IDetour diff --git a/r5dev/engine/server/sv_main.h b/r5dev/engine/server/sv_main.h index a7606db5..087a6af7 100644 --- a/r5dev/engine/server/sv_main.h +++ b/r5dev/engine/server/sv_main.h @@ -24,7 +24,7 @@ inline CMemory p_CGameServer__SpawnServer; inline bool(*CGameServer__SpawnServer)(void* thisptr, const char* pszMapName, const char* pszMapGroupName); inline CMemory p_SV_BroadcastVoiceData; -inline auto v_SV_BroadcastVoiceData = p_SV_BroadcastVoiceData.RCast(); +inline void(*v_SV_BroadcastVoiceData)(CClient* cl, int nBytes, char* data); inline bool* s_bIsDedicated = nullptr; @@ -73,7 +73,7 @@ class HSV_Main : public IDetour v_SV_ShutdownGameDLL = p_SV_ShutdownGameDLL.RCast(); v_SV_ActivateServer = p_SV_ActivateServer.RCast(); v_SV_CreateBaseline = p_SV_CreateBaseline.RCast(); - v_SV_BroadcastVoiceData = p_SV_BroadcastVoiceData.RCast(); + v_SV_BroadcastVoiceData = p_SV_BroadcastVoiceData.RCast(); CGameServer__SpawnServer = p_CGameServer__SpawnServer.RCast(); } diff --git a/r5dev/engine/sys_mainwind.h b/r5dev/engine/sys_mainwind.h index 83ddb1f4..20a9b3ec 100644 --- a/r5dev/engine/sys_mainwind.h +++ b/r5dev/engine/sys_mainwind.h @@ -8,7 +8,7 @@ #include "public/igame.h" inline CMemory p_CGame__AttachToWindow; -inline auto v_CGame__AttachToWindow= p_CGame__AttachToWindow.RCast(); +inline void (*v_CGame__AttachToWindow)(void); inline CMemory p_CGame__PlayStartupVideos; inline void(*v_CGame__PlayStartupVideos)(void); diff --git a/r5dev/filesystem/basefilesystem.h b/r5dev/filesystem/basefilesystem.h index c4dffb6d..b7397ca9 100644 --- a/r5dev/filesystem/basefilesystem.h +++ b/r5dev/filesystem/basefilesystem.h @@ -59,7 +59,7 @@ inline CMemory p_CBaseFileSystem_MountVPKFile; inline VPKData_t*(*v_CBaseFileSystem_MountVPKFile)(CBaseFileSystem* pFileSystem, const char* pszVpkPath); inline CMemory p_CBaseFileSystem_UnmountVPKFile; -inline auto v_CBaseFileSystem_UnmountVPKFile = p_CBaseFileSystem_UnmountVPKFile.RCast(); +inline const char* (*v_CBaseFileSystem_UnmountVPKFile)(CBaseFileSystem* pFileSystem, const char* pszVpkPath); inline CMemory p_CBaseFileSystem_GetMountedVPKHandle; inline int(*v_CBaseFileSystem_GetMountedVPKHandle)(CBaseFileSystem* pFileSystem, const char* pszVpkPath); diff --git a/r5dev/game/server/gameinterface.h b/r5dev/game/server/gameinterface.h index b1b2755a..68861596 100644 --- a/r5dev/game/server/gameinterface.h +++ b/r5dev/game/server/gameinterface.h @@ -48,11 +48,11 @@ class CServerGameEnts : public IServerGameEnts }; inline CMemory p_CServerGameDLL__OnReceivedSayTextMessage; -inline auto CServerGameDLL__OnReceivedSayTextMessage = p_CServerGameDLL__OnReceivedSayTextMessage.RCast(); +inline void(*CServerGameDLL__OnReceivedSayTextMessage)(void* thisptr, int senderId, const char* text, bool isTeamChat); inline CMemory p_CServerGameClients__ProcessUserCmds; -inline auto v_CServerGameClients__ProcessUserCmds = p_CServerGameClients__ProcessUserCmds.RCast(); +inline void(*v_CServerGameClients__ProcessUserCmds)(CServerGameClients* thisp, edict_t edict, bf_read* buf, + int numCmds, int totalCmds, int droppedPackets, bool ignore, bool paused); inline CMemory p_RunFrameServer; inline void(*v_RunFrameServer)(double flFrameTime, bool bRunOverlays, bool bUniformUpdate); @@ -86,7 +86,7 @@ class VServerGameDLL : public IDetour p_CServerGameClients__ProcessUserCmds = g_GameDll.FindPatternSIMD("48 89 5C 24 ?? 48 89 74 24 ?? 48 89 7C 24 ?? 55 41 55 41 57"); p_RunFrameServer = g_GameDll.FindPatternSIMD("48 89 5C 24 ?? 57 48 83 EC 30 0F 29 74 24 ?? 48 8D 0D ?? ?? ?? ??"); - CServerGameDLL__OnReceivedSayTextMessage = p_CServerGameDLL__OnReceivedSayTextMessage.RCast(); + CServerGameDLL__OnReceivedSayTextMessage = p_CServerGameDLL__OnReceivedSayTextMessage.RCast(); v_CServerGameClients__ProcessUserCmds = p_CServerGameClients__ProcessUserCmds.RCast(); v_RunFrameServer = p_RunFrameServer.RCast(); } diff --git a/r5dev/game/shared/r1/weapon_bolt.h b/r5dev/game/shared/r1/weapon_bolt.h index 3276b163..080aa3c1 100644 --- a/r5dev/game/shared/r1/weapon_bolt.h +++ b/r5dev/game/shared/r1/weapon_bolt.h @@ -12,9 +12,9 @@ CBaseEntity* CreateWeaponBolt(Vector3D* origin, Vector3D* end, __int64 unused, f int a6, int modelindex, int a8, unsigned __int8 a9, unsigned int a10, CBaseEntity* weaponEnt); inline CMemory p_CreateWeaponBolt; -inline auto v_CreateWeaponBolt = p_CreateWeaponBolt.RCast(); + int a6, int modelindex, int a8, unsigned __int8 a9, unsigned int a10, CBaseEntity* weapon); /////////////////////////////////////////////////////////////////////////////// diff --git a/r5dev/game/shared/util_shared.h b/r5dev/game/shared/util_shared.h index 589a8c26..1862a067 100644 --- a/r5dev/game/shared/util_shared.h +++ b/r5dev/game/shared/util_shared.h @@ -18,7 +18,7 @@ CPlayer* UTIL_PlayerByIndex(int nIndex); const char* UTIL_GetEntityScriptInfo(CBaseEntity* pEnt); inline CMemory p_UTIL_GetEntityScriptInfo; -inline auto v_UTIL_GetEntityScriptInfo = p_UTIL_GetEntityScriptInfo.RCast(); +inline const char*(*v_UTIL_GetEntityScriptInfo)(CBaseEntity* pEnt); inline CTraceFilterSimple* g_pTraceFilterSimpleVFTable = nullptr; typedef bool (*ShouldHitFunc_t)(IHandleEntity* pHandleEntity, int contentsMask); diff --git a/r5dev/localize/localize.h b/r5dev/localize/localize.h index 4d18e519..0a79934f 100644 --- a/r5dev/localize/localize.h +++ b/r5dev/localize/localize.h @@ -10,10 +10,10 @@ class CLocalize }; inline CMemory p_CLocalize__AddFile; -inline auto v_CLocalize__AddFile = p_CLocalize__AddFile.RCast(); +inline bool(*v_CLocalize__AddFile)(CLocalize * thisptr, const char* szFileName, const char* pPathID); inline CMemory p_CLocalize__LoadLocalizationFileLists; -inline auto v_CLocalize__LoadLocalizationFileLists = p_CLocalize__LoadLocalizationFileLists.RCast(); +inline bool(*v_CLocalize__LoadLocalizationFileLists)(CLocalize * thisptr); inline CLocalize* g_pVGuiLocalize; @@ -28,10 +28,10 @@ class VLocalize : public IDetour virtual void GetFun(void) const { p_CLocalize__AddFile = g_GameDll.FindPatternSIMD("E8 ? ? ? ? 49 FF C4").FollowNearCallSelf(); - v_CLocalize__AddFile = p_CLocalize__AddFile.RCast(); + v_CLocalize__AddFile = p_CLocalize__AddFile.RCast(); p_CLocalize__LoadLocalizationFileLists = g_GameDll.FindPatternSIMD("4C 8B DC 53 48 81 EC ? ? ? ? 33 C0"); - v_CLocalize__LoadLocalizationFileLists = p_CLocalize__LoadLocalizationFileLists.RCast(); + v_CLocalize__LoadLocalizationFileLists = p_CLocalize__LoadLocalizationFileLists.RCast(); } virtual void GetVar(void) const { diff --git a/r5dev/materialsystem/cmaterialsystem.h b/r5dev/materialsystem/cmaterialsystem.h index 349446e7..c0221a88 100644 --- a/r5dev/materialsystem/cmaterialsystem.h +++ b/r5dev/materialsystem/cmaterialsystem.h @@ -37,7 +37,7 @@ inline CMemory p_GetStreamOverlay; inline void(*v_GetStreamOverlay)(const char* mode, char* buf, size_t bufSize); inline CMemory p_DrawStreamOverlay; -inline auto v_DrawStreamOverlay = p_DrawStreamOverlay.RCast(); +inline const char*(*v_DrawStreamOverlay)(void* thisptr, uint8_t* a2, void* unused, void* a4); inline CMemory s_pRenderContext; diff --git a/r5dev/materialsystem/cshaderglue.h b/r5dev/materialsystem/cshaderglue.h index acfa24b5..d77fa290 100644 --- a/r5dev/materialsystem/cshaderglue.h +++ b/r5dev/materialsystem/cshaderglue.h @@ -31,7 +31,7 @@ static_assert(sizeof(CShaderGlue) == 0x40); // [ PIXIE ]: All vars have proper d */ /* ==== CSHADERGLUE ================================================================================================================================================== */ -inline auto CShaderGlue_SetupShader = CMemory().RCast(); +inline int(*CShaderGlue_SetupShader)(CShaderGlue* thisptr, uint64_t nCount, uint64_t a3, void* pRawMaterialGlueWithoutVTable); inline CMemory CShaderGlue_VTable; inline void* g_pShaderGlueVFTable = nullptr; diff --git a/r5dev/public/tier1/cmd.h b/r5dev/public/tier1/cmd.h index ddea7005..fd82e159 100644 --- a/r5dev/public/tier1/cmd.h +++ b/r5dev/public/tier1/cmd.h @@ -189,7 +189,7 @@ inline CMemory p_NullSub; inline void(*NullSub)(void); inline CMemory p_CallbackStub; -inline FnCommandCompletionCallback CallbackStub = p_CallbackStub.RCast(); +inline FnCommandCompletionCallback CallbackStub; inline ConCommandBase* g_pConCommandVFTable; diff --git a/r5dev/rtech/rtech_game.h b/r5dev/rtech/rtech_game.h index f79d98b0..ccbf0361 100644 --- a/r5dev/rtech/rtech_game.h +++ b/r5dev/rtech/rtech_game.h @@ -32,7 +32,7 @@ inline CMemory p_CPakFile_LoadAsync; inline RPakHandle_t(*CPakFile_LoadAsync)(const char* szPakFileName, CAlignedMemAlloc* pMalloc, int nIdx, bool bUnk); inline CMemory p_CPakFile_LoadPak; -inline auto CPakFile_LoadPak = p_CPakFile_LoadPak.RCast(); +inline unsigned int (*CPakFile_LoadPak)(void* thisptr, void* a2, uint64_t a3); inline CMemory p_CPakFile_UnloadPak; inline void(*CPakFile_UnloadPak)(RPakHandle_t handle); diff --git a/r5dev/rtech/rtech_utils.h b/r5dev/rtech/rtech_utils.h index 40f3853b..7bbfda28 100644 --- a/r5dev/rtech/rtech_utils.h +++ b/r5dev/rtech/rtech_utils.h @@ -386,7 +386,7 @@ inline void(*RTech_RegisterAsset)(int, int, const char*, void*, void*, void*, vo #ifdef GAMEDLL_S3 inline CMemory p_Pak_ProcessGuidRelationsForAsset; -inline auto RTech_Pak_ProcessGuidRelationsForAsset = p_Pak_ProcessGuidRelationsForAsset.RCast(); +inline void(*RTech_Pak_ProcessGuidRelationsForAsset)(PakFile_t*, RPakAssetEntry_t*); #endif inline CMemory p_StreamDB_Init; @@ -467,7 +467,7 @@ class V_RTechUtils : public IDetour #ifdef GAMEDLL_S3 p_Pak_ProcessGuidRelationsForAsset = g_GameDll.FindPatternSIMD("E8 ?? ?? ?? ?? 48 8B 86 ?? ?? ?? ?? 42 8B 0C B0").FollowNearCallSelf(); - RTech_Pak_ProcessGuidRelationsForAsset = p_Pak_ProcessGuidRelationsForAsset.RCast(); /*E8 ? ? ? ? 48 8B 86 ? ? ? ? 42 8B 0C B0*/ + RTech_Pak_ProcessGuidRelationsForAsset = p_Pak_ProcessGuidRelationsForAsset.RCast(); /*E8 ? ? ? ? 48 8B 86 ? ? ? ? 42 8B 0C B0*/ #endif } virtual void GetVar(void) const diff --git a/r5dev/vpc/keyvalues.h b/r5dev/vpc/keyvalues.h index a6d737b4..9c566f0f 100644 --- a/r5dev/vpc/keyvalues.h +++ b/r5dev/vpc/keyvalues.h @@ -30,7 +30,7 @@ inline CMemory p_KeyValues_ParsePlaylists; inline bool(*KeyValues_ParsePlaylists)(const char* pszPlaylist); inline CMemory p_KeyValues_GetCurrentPlaylist; -inline auto KeyValues_GetCurrentPlaylist = p_KeyValues_GetCurrentPlaylist.RCast(); +inline const char* (*KeyValues_GetCurrentPlaylist)(void); inline CMemory p_KeyValues_ReadKeyValuesFile; inline KeyValues*(*KeyValues_ReadKeyValuesFile)(CFileSystem_Stdio* pFileSystem, const char* pFileName); diff --git a/r5dev/vpc/rson.h b/r5dev/vpc/rson.h index 2260af43..19f980b3 100644 --- a/r5dev/vpc/rson.h +++ b/r5dev/vpc/rson.h @@ -85,10 +85,10 @@ public: }; /////////////////////////////////////////////////////////////////////////////// inline CMemory p_RSON_LoadFromBuffer; -inline auto RSON_LoadFromBuffer = p_RSON_LoadFromBuffer.RCast(); +inline RSON::Node_t* (*RSON_LoadFromBuffer)(const char* bufName, char* buf, RSON::eFieldType rootType, __int64 a4, void* a5); inline CMemory p_RSON_Free; -inline auto RSON_Free = p_RSON_Free.RCast(); +inline void (*RSON_Free)(RSON::Node_t* rson, CAlignedMemAlloc* allocator); /////////////////////////////////////////////////////////////////////////////// class VRSON : public IDetour @@ -101,10 +101,10 @@ class VRSON : public IDetour virtual void GetFun(void) const { p_RSON_LoadFromBuffer = g_GameDll.FindPatternSIMD("E8 ?? ?? ?? ?? 48 89 45 60 48 8B D8").FollowNearCallSelf(); - RSON_LoadFromBuffer = p_RSON_LoadFromBuffer.RCast< RSON::Node_t * (__fastcall*)(const char* bufName, char* buf, RSON::eFieldType rootType, __int64 a4, void* a5)>(); + RSON_LoadFromBuffer = p_RSON_LoadFromBuffer.RCast< RSON::Node_t* (*)(const char*, char*, RSON::eFieldType, __int64, void*)>(); p_RSON_Free = g_GameDll.FindPatternSIMD("E8 ?? ?? ?? ?? 48 83 EF 01 75 E7").FollowNearCallSelf(); - RSON_Free = p_RSON_Free.RCast(); + RSON_Free = p_RSON_Free.RCast(); } virtual void GetVar(void) const { } virtual void GetCon(void) const { } diff --git a/r5dev/vscript/languages/squirrel_re/vsquirrel.h b/r5dev/vscript/languages/squirrel_re/vsquirrel.h index 2e6a321d..627a0c25 100644 --- a/r5dev/vscript/languages/squirrel_re/vsquirrel.h +++ b/r5dev/vscript/languages/squirrel_re/vsquirrel.h @@ -44,7 +44,7 @@ private: #pragma pack(pop) inline CMemory p_CSquirrelVM_Init; -inline auto v_CSquirrelVM_Init = p_CSquirrelVM_Init.RCast(); +inline bool(*v_CSquirrelVM_Init)(CSquirrelVM* s, SQCONTEXT context, SQFloat curtime); inline CMemory p_CSquirrelVM_DestroySignalEntryListHead; inline SQBool(*v_CSquirrelVM_DestroySignalEntryListHead)(CSquirrelVM* s, HSQUIRRELVM v, SQFloat f); @@ -57,12 +57,12 @@ inline SQRESULT(*v_CSquirrelVM_RegisterConstant)(CSquirrelVM* s, const SQChar* n #ifndef DEDICATED inline CMemory p_CSquirrelVM_PrecompileClientScripts; -inline auto v_CSquirrelVM_PrecompileClientScripts = p_CSquirrelVM_PrecompileClientScripts.RCast(); +inline bool(*v_CSquirrelVM_PrecompileClientScripts)(CSquirrelVM* vm, SQCONTEXT context, char** scriptArray, int scriptCount); #endif #ifndef CLIENT_DLL inline CMemory p_CSquirrelVM_PrecompileServerScripts; -inline auto v_CSquirrelVM_PrecompileServerScripts = p_CSquirrelVM_PrecompileServerScripts.RCast(); +inline bool(*v_CSquirrelVM_PrecompileServerScripts)(CSquirrelVM* vm, SQCONTEXT context, char** scriptArray, int scriptCount); #endif #ifndef CLIENT_DLL @@ -95,7 +95,7 @@ class VSquirrel : public IDetour virtual void GetFun(void) const { p_CSquirrelVM_Init = g_GameDll.FindPatternSIMD("E8 ?? ?? ?? ?? 0F 28 74 24 ?? 48 89 1D ?? ?? ?? ??").FollowNearCallSelf(); - v_CSquirrelVM_Init = p_CSquirrelVM_Init.RCast(); + v_CSquirrelVM_Init = p_CSquirrelVM_Init.RCast(); p_CSquirrelVM_DestroySignalEntryListHead = g_GameDll.FindPatternSIMD("48 89 5C 24 ?? 48 89 6C 24 ?? 56 57 41 56 48 83 EC 50 44 8B 42"); v_CSquirrelVM_DestroySignalEntryListHead = p_CSquirrelVM_DestroySignalEntryListHead.RCast(); @@ -109,13 +109,13 @@ class VSquirrel : public IDetour #ifndef CLIENT_DLL // sv scripts.rson compiling p_CSquirrelVM_PrecompileServerScripts = g_GameDll.FindPatternSIMD("E8 ?? ?? ?? ?? 0F B6 F0 48 85 DB").FollowNearCallSelf(); - v_CSquirrelVM_PrecompileServerScripts = p_CSquirrelVM_PrecompileServerScripts.RCast(); + v_CSquirrelVM_PrecompileServerScripts = p_CSquirrelVM_PrecompileServerScripts.RCast(); #endif #ifndef DEDICATED // cl/ui scripts.rson compiling p_CSquirrelVM_PrecompileClientScripts = g_GameDll.FindPatternSIMD("E8 ?? ?? ?? ?? 44 0F B6 F0 48 85 DB").FollowNearCallSelf(); - v_CSquirrelVM_PrecompileClientScripts = p_CSquirrelVM_PrecompileClientScripts.RCast(); + v_CSquirrelVM_PrecompileClientScripts = p_CSquirrelVM_PrecompileClientScripts.RCast(); #endif } virtual void GetVar(void) const { } diff --git a/r5dev/vscript/vscript.h b/r5dev/vscript/vscript.h index ae6428a5..3eb436fe 100644 --- a/r5dev/vscript/vscript.h +++ b/r5dev/vscript/vscript.h @@ -20,19 +20,19 @@ inline CMemory p_Script_LoadScriptFile; inline SQBool(*v_Script_LoadScriptFile)(HSQUIRRELVM v, const SQChar* path, const SQChar* name, SQInteger flags); inline CMemory p_Script_ParseScriptList; -inline auto v_Script_ParseScriptList = p_Script_ParseScriptList.RCast(); +inline SQBool(*v_Script_ParseScriptList)(SQCONTEXT ctx, const char* scriptListPath, RSON::Node_t* rson, char** scriptArray, int* pScriptCount, char** precompiledScriptArray, int precompiledScriptCount); inline CMemory p_Script_PrecompileServerScripts; -inline auto v_Script_PrecompileServerScripts = p_Script_PrecompileServerScripts.RCast(); +inline SQBool(*v_Script_PrecompileServerScripts)(CSquirrelVM* vm /*This parameter is not used internally (the client variant does use it)!*/); inline CMemory p_Script_SetServerCompiler; -inline auto v_Script_SetServerPrecompiler = p_Script_SetServerCompiler.RCast(); +inline void(*v_Script_SetServerPrecompiler)(SQCONTEXT ctx, RSON::Node_t* rson); inline CMemory p_Script_PrecompileClientScripts; -inline auto v_Script_PrecompileClientScripts = p_Script_PrecompileClientScripts.RCast(); +inline SQBool(*v_Script_PrecompileClientScripts)(CSquirrelVM* vm); inline CMemory p_Script_SetClientCompiler; -inline auto v_Script_SetClientPrecompiler = p_Script_SetClientCompiler.RCast(); +inline void(*v_Script_SetClientPrecompiler)(SQCONTEXT ctx, RSON::Node_t* rson); void Script_RegisterServerFunctions(CSquirrelVM* s); void Script_RegisterClientFunctions(CSquirrelVM* s);