From 9f163333419983d36e92a8ab0c314a92fc7ed97f Mon Sep 17 00:00:00 2001 From: ccw808 Date: Tue, 13 Mar 2018 09:26:49 +0000 Subject: [PATCH] Remove trailing spaces in _asm blocks and preprocessor definitions --- Client/core/CJoystickManager.cpp | 12 +- Client/game_sa/CAnimBlendAssocGroupSA.cpp | 2 +- Client/game_sa/CAudioEngineSA.cpp | 42 ++-- Client/game_sa/CCameraSA.cpp | 2 +- Client/game_sa/CCameraSA.h | 6 +- Client/game_sa/CCarEnterExitSA.cpp | 2 +- Client/game_sa/CDamageManagerSA.cpp | 2 +- Client/game_sa/CDamageManagerSA.h | 2 +- Client/game_sa/CExplosionManagerSA.cpp | 2 +- Client/game_sa/CFireManagerSA.h | 2 +- Client/game_sa/CFxSystemSA.cpp | 6 +- Client/game_sa/CGameSA.cpp | 2 +- Client/game_sa/CModelInfoSA.cpp | 12 +- Client/game_sa/CModelInfoSA.h | 4 +- Client/game_sa/CPedSA.cpp | 16 +- Client/game_sa/CPedSA.h | 4 +- Client/game_sa/CPhysicalSA.cpp | 4 +- Client/game_sa/CPoolsSA.cpp | 6 +- Client/game_sa/CProjectileInfoSA.cpp | 2 +- .../game_sa/CRenderWareSA.ShaderSupport.cpp | 2 +- Client/game_sa/CSettingsSA.cpp | 4 +- Client/game_sa/CTaskManagerSA.cpp | 2 +- Client/game_sa/CVehicleSA.cpp | 8 +- Client/game_sa/CWorldSA.cpp | 10 +- Client/loader/CExePatchedStatus.cpp | 2 +- Client/loader/Main.cpp | 4 +- Client/mods/deathmatch/logic/CClientPed.cpp | 2 +- .../mods/deathmatch/logic/CClientVehicle.cpp | 2 +- .../mods/deathmatch/logic/luadefs/CLuaDefs.h | 2 +- Client/multiplayer_sa/CMultiplayerSA.cpp | 88 +++---- Client/multiplayer_sa/CMultiplayerSA_1.3.cpp | 6 +- .../CMultiplayerSA_ClothesCache.cpp | 2 +- .../CMultiplayerSA_ClothesSpeedUp.cpp | 2 +- .../CMultiplayerSA_CrashFixHacks.cpp | 214 +++++++++--------- .../CMultiplayerSA_Direct3D.cpp | 14 +- .../multiplayer_sa/CMultiplayerSA_Files.cpp | 4 +- .../CMultiplayerSA_FixLineOfSightArgs.cpp | 4 +- .../CMultiplayerSA_ObjectLODSystem.cpp | 6 +- .../CMultiplayerSA_Rendering.cpp | 14 +- .../multiplayer_sa/CMultiplayerSA_Weapons.cpp | 6 +- Client/multiplayer_sa/CPopulationSA.cpp | 2 +- Client/multiplayer_sa/multiplayer_keysync.h | 8 +- .../multiplayer_sa/multiplayer_shotsync.cpp | 116 +++++----- Client/sdk/game/CControllerConfigManager.h | 4 +- Client/sdk/game/Common.h | 8 +- Server/core/CCrashHandlerAPI.cpp | 2 +- Server/mods/deathmatch/CServer.cpp | 4 +- .../deathmatch/logic/CBandwidthSettings.h | 2 +- Server/mods/deathmatch/logic/CCommon.h | 4 +- .../deathmatch/logic/CResourceChecker.cpp | 2 +- .../deathmatch/logic/lua/CLuaFunctionDefs.h | 2 +- .../mods/deathmatch/logic/luadefs/CLuaDefs.h | 2 +- Server/mods/deathmatch/utils/CZipMaker.h | 2 +- .../deathmatch/logic/luascripts/exports.lua.h | 2 +- .../deathmatch/logic/luascripts/inspect.lua.h | 8 +- Shared/sdk/RTree.h | 4 +- Shared/sdk/SString.h | 2 +- Shared/sdk/SharedUtil.Defines.h | 2 +- Shared/sdk/SharedUtil.Game.h | 2 +- Shared/sdk/SharedUtil.Misc.h | 2 +- Shared/sdk/SharedUtil.Profiling.h | 4 +- utils/win-apply-clang-format.bat | 11 +- 62 files changed, 364 insertions(+), 359 deletions(-) diff --git a/Client/core/CJoystickManager.cpp b/Client/core/CJoystickManager.cpp index ebf519648db..5951760f677 100644 --- a/Client/core/CJoystickManager.cpp +++ b/Client/core/CJoystickManager.cpp @@ -400,12 +400,12 @@ BOOL CJoystickManager::DoEnumObjectsCallback(const DIDEVICEOBJECTINSTANCE* pdido CCore::GetSingleton ().GetConsole ()->Printf( "%p dwHow:%d dwObj:%d guid:%x index:%d lMin:%d lMax:%d" ,m_DevInfo.pDevice - ,range.diph.dwHow - ,range.diph.dwObj - ,pdidoi->guidType.Data1 - ,axisIndex - ,range.lMin - ,range.lMax + ,range.diph.dwHow + ,range.diph.dwObj + ,pdidoi->guidType.Data1 + ,axisIndex + ,range.lMin + ,range.lMax ); #endif diff --git a/Client/game_sa/CAnimBlendAssocGroupSA.cpp b/Client/game_sa/CAnimBlendAssocGroupSA.cpp index dd69b2a2fc2..3a08086ef0c 100644 --- a/Client/game_sa/CAnimBlendAssocGroupSA.cpp +++ b/Client/game_sa/CAnimBlendAssocGroupSA.cpp @@ -72,7 +72,7 @@ CAnimBlendStaticAssociation* CAnimBlendAssocGroupSA::GetAnimation(unsigned int I DWORD dwThis = (DWORD)m_pInterface; DWORD dwFunc = FUNC_CAnimBlendAssocGroup_GetAnimation; _asm - { + { mov ecx, dwThis push ID call dwFunc diff --git a/Client/game_sa/CAudioEngineSA.cpp b/Client/game_sa/CAudioEngineSA.cpp index 636e935702b..21c474fad22 100644 --- a/Client/game_sa/CAudioEngineSA.cpp +++ b/Client/game_sa/CAudioEngineSA.cpp @@ -54,7 +54,8 @@ VOID CAudioEngineSA::StopRadio() // DWORD dwFunc = FUNC_StopRadio; DWORD dwFunc = 0x4E9823; // Some function CAudio::StopRadio jumps to immediately - _asm { + _asm + { // This doesn't work anymore because we've // returned out the function. /* @@ -70,15 +71,15 @@ VOID CAudioEngineSA::StopRadio() push 0 push retpoint - // Do what CAudio::StopRadio does. Mov the AERadioTrackManager class instance into 'ecx' (this) + // Do what CAudio::StopRadio does. Mov the AERadioTrackManager class instance into 'ecx' (this) mov ecx, CLASS_AERadioTrackManager - // Do what this global func we've removed does in the beginning. - push ebx - push ebp + // Do what this global func we've removed does in the beginning. + push ebx + push ebp push esi - // Jump to behind the return code we've replaced. + // Jump to behind the return code we've replaced. jmp dwFunc retpoint: @@ -97,7 +98,8 @@ VOID CAudioEngineSA::StartRadio(unsigned int station) DWORD dwFunc = 0x4DBEC3; DWORD dwFunc2 = 0x4EB3C3; - _asm { + _asm + { // We can't do this anymore as we've returned out StartRadio /* push 0 @@ -110,32 +112,32 @@ VOID CAudioEngineSA::StartRadio(unsigned int station) push 0 push station - // Call something, skip 3 bytes that we have our return instruction on (no arguments) - mov ecx,CLASS_AECutsceneTrackManager - mov eax,dword ptr [ecx+8] + // Call something, skip 3 bytes that we have our return instruction on (no arguments) + mov ecx,CLASS_AECutsceneTrackManager + mov eax,dword ptr [ecx+8] call dwFunc - // Check the return value, eventually skip - test al,al + // Check the return value, eventually skip + test al,al jne skip - mov eax,dword ptr [esp+4] + mov eax,dword ptr [esp+4] mov ecx,dword ptr [esp] // Push arguments to some other function push 0 push 0 - push eax + push eax push ecx - // Call it (emulate call instruction) - mov ecx,8CB6F8h + // Call it (emulate call instruction) + mov ecx,8CB6F8h push done - push ebx - mov bl,byte ptr [esp+8] + push ebx + mov bl,byte ptr [esp+8] jmp dwFunc2 - // Pop our arguments back + // Pop our arguments back done: pop eax pop eax @@ -525,7 +527,7 @@ void _declspec(naked) HOOK_CAESoundManager_RequestNewSound() push edi xor esi, esi jmp RETURN_CAESoundManager_RequestNewSound - + skip: // Skip playing sound popad xor eax, eax diff --git a/Client/game_sa/CCameraSA.cpp b/Client/game_sa/CCameraSA.cpp index 3b597a349d9..f183a57404d 100644 --- a/Client/game_sa/CCameraSA.cpp +++ b/Client/game_sa/CCameraSA.cpp @@ -590,7 +590,7 @@ void _declspec(naked) HOOK_Camera_CollisionDetection() call DoCameraCollisionDetectionPokes popad sub esp,24h - push ebx + push ebx push ebp jmp RETURN_Camera_CollisionDetection } diff --git a/Client/game_sa/CCameraSA.h b/Client/game_sa/CCameraSA.h index 4a69ed2d046..1de6bc57990 100644 --- a/Client/game_sa/CCameraSA.h +++ b/Client/game_sa/CCameraSA.h @@ -40,7 +40,7 @@ #define VAR_CameraRotation 0xB6F178 // used for controling where the player faces #define VAR_VehicleCameraView 0xB6F0DC -#define MAX_CAMS 3 +#define MAX_CAMS 3 #define MAX_NUM_OF_NODES 800 // for trains @@ -139,9 +139,9 @@ class CCameraSAInterface bool m_bAllowShootingWith2PlayersInCar; bool m_bDisableFirstPersonInCar; static bool m_bUseMouse3rdPerson; -#ifndef FINALBUILD +#ifndef FINALBUILD bool bStaticFrustum; -#endif +#endif // for debug keyboard stuff #ifndef MASTER diff --git a/Client/game_sa/CCarEnterExitSA.cpp b/Client/game_sa/CCarEnterExitSA.cpp index d002200f669..0899a2bd7ca 100644 --- a/Client/game_sa/CCarEnterExitSA.cpp +++ b/Client/game_sa/CCarEnterExitSA.cpp @@ -61,7 +61,7 @@ bool CCarEnterExitSA::GetNearestCarPassengerDoor(CPed* pPed, CVehicle* pVehicle, push ebx mov bl, bUnknown push ebx - push pDoor + push pDoor push pVector push pVehicleInterface push pPedInterface diff --git a/Client/game_sa/CDamageManagerSA.cpp b/Client/game_sa/CDamageManagerSA.cpp index 20b87cc0d89..98cd595d3c9 100644 --- a/Client/game_sa/CDamageManagerSA.cpp +++ b/Client/game_sa/CDamageManagerSA.cpp @@ -287,5 +287,5 @@ VOID CDamageManagerSA::FuckCarCompletely(BOOL bKeepWheels) mov ecx, dwPointer push bKeepWheels call dwFunc - } + } } diff --git a/Client/game_sa/CDamageManagerSA.h b/Client/game_sa/CDamageManagerSA.h index 8ae03d3386d..32a40e12f1e 100644 --- a/Client/game_sa/CDamageManagerSA.h +++ b/Client/game_sa/CDamageManagerSA.h @@ -15,7 +15,7 @@ #include #include "Common.h" -#define FUNC_GetEngineStatus 0x6c22c0 +#define FUNC_GetEngineStatus 0x6c22c0 #define FUNC_SetEngineStatus 0x6c22a0 #define FUNC_GetDoorStatus 0x6c2230 #define FUNC_SetDoorStatus 0x6c21c0 diff --git a/Client/game_sa/CExplosionManagerSA.cpp b/Client/game_sa/CExplosionManagerSA.cpp index 4681d2d5a68..abcb478b2ac 100644 --- a/Client/game_sa/CExplosionManagerSA.cpp +++ b/Client/game_sa/CExplosionManagerSA.cpp @@ -62,7 +62,7 @@ CExplosion *CExplosionManagerSA::AddExplosion(CEntity *pExplodingEntity, CEntity mov ebx, dwFunc // Now jump in 6 bytes later (6 bytes might be used for our patch-jump in Multiplayer) add ebx, 6 jmp ebx - + returnhere: add esp, 0x28 mov bReturn, al diff --git a/Client/game_sa/CFireManagerSA.h b/Client/game_sa/CFireManagerSA.h index 10c59cf2e09..a5ce5cfc1b1 100644 --- a/Client/game_sa/CFireManagerSA.h +++ b/Client/game_sa/CFireManagerSA.h @@ -18,7 +18,7 @@ #define FUNC_ExtinguishPoint 0x48E520 #define FUNC_StartFire 0x48EC30 -#define FUNC_StartFire_Vec 0x539F00 // ##SA## +#define FUNC_StartFire_Vec 0x539F00 // ##SA## #define ARRAY_CFire VAR_CFireCount + 4 diff --git a/Client/game_sa/CFxSystemSA.cpp b/Client/game_sa/CFxSystemSA.cpp index 26c09d1305e..978f0df1f8e 100644 --- a/Client/game_sa/CFxSystemSA.cpp +++ b/Client/game_sa/CFxSystemSA.cpp @@ -175,9 +175,9 @@ void _declspec(naked) HOOK_FxSystem_c_Update_MidA() retn 8 inner: - sub esp, 10h - push ebx - push ebp + sub esp, 10h + push ebx + push ebp jmp RETURN_FxSystem_c_Update_MidA } } diff --git a/Client/game_sa/CGameSA.cpp b/Client/game_sa/CGameSA.cpp index 4a4bc055eb8..0542499f902 100644 --- a/Client/game_sa/CGameSA.cpp +++ b/Client/game_sa/CGameSA.cpp @@ -480,7 +480,7 @@ void CGameSA::Terminate(void) delete this; // Dump any memory leaks if DETECT_LEAK is defined - #ifdef DETECT_LEAKS + #ifdef DETECT_LEAKS DumpUnfreed(); #endif } diff --git a/Client/game_sa/CModelInfoSA.cpp b/Client/game_sa/CModelInfoSA.cpp index c1badf29cef..b387af45b8b 100644 --- a/Client/game_sa/CModelInfoSA.cpp +++ b/Client/game_sa/CModelInfoSA.cpp @@ -272,7 +272,7 @@ char* CModelInfoSA::GetNameIfVehicle() DWORD dwReturn = 0; _asm - { + { push eax push ebx push ecx @@ -1215,15 +1215,15 @@ void _declspec(naked) HOOK_CFileLoader_LoadCollisionFile_Mid() jz skip popad - sub edx,18h - add ebp,2 + sub edx,18h + add ebp,2 jmp RETURN_CFileLoader_LoadCollisionFile_Mid skip: popad - sub edx,18h - add ebp,2 - mov dword ptr [esp+4Ch],edx + sub edx,18h + add ebp,2 + mov dword ptr [esp+4Ch],edx jmp RETURN_CFileLoader_LoadCollisionFile_Mid_Skip } } diff --git a/Client/game_sa/CModelInfoSA.h b/Client/game_sa/CModelInfoSA.h index e65f1958157..c896d5121f2 100644 --- a/Client/game_sa/CModelInfoSA.h +++ b/Client/game_sa/CModelInfoSA.h @@ -47,8 +47,8 @@ class CPedModelInfoSAInterface; #define FUNC_IsHeliModel 0x4c5b00 #define FUNC_IsPlaneModel 0x4c5b30 #define FUNC_IsBikeModel 0x4c5b60 -#define FUNC_IsFakePlaneModel 0x4c5b90 -#define FUNC_IsMonsterTruckModel 0x4c5bc0 +#define FUNC_IsFakePlaneModel 0x4c5b90 +#define FUNC_IsMonsterTruckModel 0x4c5bc0 #define FUNC_IsQuadBikeModel 0x4c5bf0 #define FUNC_IsBmxModel 0x4c5c20 #define FUNC_IsTrailerModel 0x4c5c50 diff --git a/Client/game_sa/CPedSA.cpp b/Client/game_sa/CPedSA.cpp index 07885ac32bb..27ceb4c766d 100644 --- a/Client/game_sa/CPedSA.cpp +++ b/Client/game_sa/CPedSA.cpp @@ -153,7 +153,7 @@ void CPedSA::AttachPedToBike(CEntity* entity, CVector* vector, unsigned short sU mov ecx, dwThis push dwEntityInterface call dwFunc - } + } } bool CPedSA::AddProjectile(eWeaponType eWeapon, CVector vecOrigin, float fForce, CVector* target, CEntity* targetEntity) @@ -1771,14 +1771,14 @@ void _declspec(naked) HOOK_CPed_PreRenderAfterTest() mov eax,[esp-32-4*1] // Get result temp // Replaced code - sub esp,70h - push ebx + sub esp,70h + push ebx push ebp - push esi - mov ebp,ecx - mov ecx,dword ptr [ebp+47Ch] - push edi - + push esi + mov ebp,ecx + mov ecx,dword ptr [ebp+47Ch] + push edi + // Check what to do cmp eax,0 jnz skip_rotation_update diff --git a/Client/game_sa/CPedSA.h b/Client/game_sa/CPedSA.h index c7bc21f8bc3..2e1b33aca0d 100644 --- a/Client/game_sa/CPedSA.h +++ b/Client/game_sa/CPedSA.h @@ -36,7 +36,7 @@ class CPedIntelligenceSAInterface; #define SIZEOF_CPLAYERPED 1956 #define FUNC_SetModelIndex 0x5E4880 // ##SA## -#define FUNC_AttachPedToBike 0x5E7E60 +#define FUNC_AttachPedToBike 0x5E7E60 #define FUNC_AttachPedToEntity 0x5E7CB0 #define FUNC_CanSeeEntity 0x5E0730 #define FUNC_GiveObjectToPedToHold 0x5E4390 @@ -71,7 +71,7 @@ class CPedIntelligenceSAInterface; #define FUNC_TakeOffGoggles 0x5E6010 // ##SA## #define FUNC_PutOnGoggles 0x5E3AE0 // ##SA## #define FUNC_RemoveWeaponModel 0x5E3990 // ##SA## (call with -1 to remove any model, I think) -#define FUNC_RemoveGogglesModel 0x5DF170 // ##SA## +#define FUNC_RemoveGogglesModel 0x5DF170 // ##SA## #define FUNC_ClearWeapon 0x5E62B0 // ##SA## #define FUNC_GetHealth 0x4ABC20 #define FUNC_SetCurrentWeaponFromID 0x4FF8E0 diff --git a/Client/game_sa/CPhysicalSA.cpp b/Client/game_sa/CPhysicalSA.cpp index 75868171166..6e3100416be 100644 --- a/Client/game_sa/CPhysicalSA.cpp +++ b/Client/game_sa/CPhysicalSA.cpp @@ -283,7 +283,7 @@ void CPhysicalSA::DetachEntityFromEntity(float fUnkX, float fUnkY, float fUnkZ, push fUnkY push fUnkX mov ecx, dwThis - call dwFunc + call dwFunc } } @@ -306,7 +306,7 @@ bool CPhysicalSA::InternalAttachEntityToEntity(DWORD dwEntityInterface, const CV push dwEntityInterface mov ecx, dwThis call dwFunc - mov dwReturn, eax + mov dwReturn, eax } return (dwReturn != NULL); } diff --git a/Client/game_sa/CPoolsSA.cpp b/Client/game_sa/CPoolsSA.cpp index ef2c1ec06b5..21c62f9b24d 100644 --- a/Client/game_sa/CPoolsSA.cpp +++ b/Client/game_sa/CPoolsSA.cpp @@ -943,15 +943,15 @@ CVehicle* CPoolsSA::AddTrain(CVector* vecPosition, DWORD dwModels[], int iSize, push iNodeId // node to start at (-1 for closest node) lea ecx, pTrainEnd push ecx // end of train - lea ecx, pTrainBeginning + lea ecx, pTrainBeginning push ecx // begining of train push 0 // train type (always use 0 as thats where we're writing to) - push bDirection // direction + push bDirection // direction push fZ // z push fY // y push fX // x call dwFunc - add esp, 0x28 + add esp, 0x28 } // Enable GetVehicle diff --git a/Client/game_sa/CProjectileInfoSA.cpp b/Client/game_sa/CProjectileInfoSA.cpp index bf1bf0e0d7f..b4c1ac07c54 100644 --- a/Client/game_sa/CProjectileInfoSA.cpp +++ b/Client/game_sa/CProjectileInfoSA.cpp @@ -149,7 +149,7 @@ bool CProjectileInfoSA::AddProjectile(CEntity* creator, eWeaponType eWeapon, CVe _asm { push eax - + push targetVC push target push fForce diff --git a/Client/game_sa/CRenderWareSA.ShaderSupport.cpp b/Client/game_sa/CRenderWareSA.ShaderSupport.cpp index 28d3d79347e..6d100e4b799 100644 --- a/Client/game_sa/CRenderWareSA.ShaderSupport.cpp +++ b/Client/game_sa/CRenderWareSA.ShaderSupport.cpp @@ -93,7 +93,7 @@ void _declspec(naked) HOOK_CTxdStore_SetupTxdParent() popad // orig - mov esi, ds:00C8800Ch + mov esi, ds:00C8800Ch jmp RETURN_CTxdStore_SetupTxdParent // 731D5B } } diff --git a/Client/game_sa/CSettingsSA.cpp b/Client/game_sa/CSettingsSA.cpp index 12d3136b83b..8fc2d96799b 100644 --- a/Client/game_sa/CSettingsSA.cpp +++ b/Client/game_sa/CSettingsSA.cpp @@ -372,7 +372,7 @@ void _declspec(naked) HOOK_GetFxQuality() mov dwFxQualityValue, eax mov eax, [esp+32] // Address GetFxQuality was called from - push eax + push eax call MaybeAlterFxQualityValue add esp, 4 @@ -391,7 +391,7 @@ void _declspec(naked) HOOK_StoreShadowForVehicle() mov eax, [esp+4] // Get vehicle mov ax, [eax+34] // pEntity->m_nModelIndex mov usCallingForVehicleModel, ax - sub esp, 44h + sub esp, 44h push ebx mov eax, 0x70F9B0 // CVolumetricShadowMgr::IsAvailable call eax diff --git a/Client/game_sa/CTaskManagerSA.cpp b/Client/game_sa/CTaskManagerSA.cpp index 5d26fe49de8..fe162a07cb0 100644 --- a/Client/game_sa/CTaskManagerSA.cpp +++ b/Client/game_sa/CTaskManagerSA.cpp @@ -46,7 +46,7 @@ void CTaskManagerSA::SetTask(CTaskSA* pTaskPrimary, const int iTaskPriority, con push taskInterface mov ecx, dwInterface call dwFunc - } + } } CTask* CTaskManagerSA::GetTask(const int iTaskPriority) diff --git a/Client/game_sa/CVehicleSA.cpp b/Client/game_sa/CVehicleSA.cpp index 90beff73424..5d5c8912eb7 100644 --- a/Client/game_sa/CVehicleSA.cpp +++ b/Client/game_sa/CVehicleSA.cpp @@ -150,7 +150,7 @@ CVehicleSA::CVehicleSA(eVehicleTypes dwModelID, unsigned char ucVariation, unsig push 0 push 0 push 0 // spawn at 0,0,0 - push dwModelID + push dwModelID call dwFunc add esp, 0x14 mov dwReturn, eax @@ -162,7 +162,7 @@ CVehicleSA::CVehicleSA(eVehicleTypes dwModelID, unsigned char ucVariation, unsig m_pInterface->bStreamingDontDelete = true; m_pInterface->bDontStream = true; - + // store our CVehicleSA pointer in the vehicle's time of creation member (as it won't get modified later and as far as I know it isn't used for something important) GetVehicleInterface ()->m_pVehicle = this; @@ -1706,7 +1706,7 @@ bool CVehicleSA::BreakTowLink(void) _asm { - mov ecx, dwThis + mov ecx, dwThis call dwFunc mov bReturn, al } @@ -1792,7 +1792,7 @@ CPhysical* CVehicleSA::QueryPickedUpEntityWithWinch() CPhysical* physRet; _asm { - mov ecx, dwThis + mov ecx, dwThis call dwFunc mov phys, eax } diff --git a/Client/game_sa/CWorldSA.cpp b/Client/game_sa/CWorldSA.cpp index fb16f12a124..224e585a1d6 100644 --- a/Client/game_sa/CWorldSA.cpp +++ b/Client/game_sa/CWorldSA.cpp @@ -102,7 +102,7 @@ void CWorldSA::Remove(CEntitySAInterface* entityInterface, eDebugCaller CallerId /* mov ecx, entityInterface mov esi, [ecx] push 1 - call dword ptr [esi+8]*/ + call dword ptr [esi+8]*/ } } @@ -203,9 +203,9 @@ bool CWorldSA::ProcessLineOfSight(const CVector* vecStart, const CVector* vecEnd push flags.bCheckBuildings lea eax, targetEntity push eax - push pColPointSAInterface + push pColPointSAInterface push vecEnd - push vecStart + push vecStart call dwFunc mov bReturn, al add esp, 0x30 @@ -418,7 +418,7 @@ bool CWorldSA::IsLineOfSightClear(const CVector* vecStart, const CVector* vecEnd push flags.bCheckVehicles push flags.bCheckBuildings push vecEnd - push vecStart + push vecStart call dwFunc mov bReturn, al add esp, 0x24 @@ -437,7 +437,7 @@ bool CWorldSA::HasCollisionBeenLoaded(CVector* vecPosition) call dwFunc mov bRet, al add esp, 8 - } + } return bRet; } diff --git a/Client/loader/CExePatchedStatus.cpp b/Client/loader/CExePatchedStatus.cpp index 8518160f4cc..7b6e0f67935 100644 --- a/Client/loader/CExePatchedStatus.cpp +++ b/Client/loader/CExePatchedStatus.cpp @@ -375,7 +375,7 @@ EPatchResult UpdatePatchStatusDep(const SString& strGTAEXEPath, EPatchMode mode) ////////////////////////////////////////////////////////// namespace { - #define EU_VERSION_BYTE 0x004A1AA0 // Zero if US version + #define EU_VERSION_BYTE 0x004A1AA0 // Zero if US version uint oldExportDir[] = {0, 0}; uint newExportDir[] = {0x004a32d0, 0x00000060}; diff --git a/Client/loader/Main.cpp b/Client/loader/Main.cpp index ac3a3c863c1..14b8eeeb7cf 100644 --- a/Client/loader/Main.cpp +++ b/Client/loader/Main.cpp @@ -11,7 +11,7 @@ #include "StdInc.h" #include "SharedUtil.Win32Utf8FileHooks.hpp" -#if defined(MTA_DEBUG) +#if defined(MTA_DEBUG) #include "SharedUtil.Tests.hpp" #endif @@ -30,7 +30,7 @@ MTAEXPORT int DoWinMain(HINSTANCE hLauncherInstance, HINSTANCE hPrevInstance, LP { AddUtf8FileHooks(); -#if defined(MTA_DEBUG) +#if defined(MTA_DEBUG) SharedUtil_Tests(); #endif diff --git a/Client/mods/deathmatch/logic/CClientPed.cpp b/Client/mods/deathmatch/logic/CClientPed.cpp index 61ee8259e2d..08525cc4c5b 100644 --- a/Client/mods/deathmatch/logic/CClientPed.cpp +++ b/Client/mods/deathmatch/logic/CClientPed.cpp @@ -6031,7 +6031,7 @@ void CClientPed::HandleWaitingForGroundToLoad(void) SetFrozenWaitingForGroundToLoad(false); #ifdef ASYNC_LOADING_DEBUG_OUTPUTA OutputDebugLine("[AsyncLoading] FreezeUntilCollisionLoaded - Early stop"); - #endif + #endif return; } diff --git a/Client/mods/deathmatch/logic/CClientVehicle.cpp b/Client/mods/deathmatch/logic/CClientVehicle.cpp index 7363cb576c4..6e52762d072 100644 --- a/Client/mods/deathmatch/logic/CClientVehicle.cpp +++ b/Client/mods/deathmatch/logic/CClientVehicle.cpp @@ -4252,7 +4252,7 @@ void CClientVehicle::HandleWaitingForGroundToLoad(void) SetFrozenWaitingForGroundToLoad(false, true); #ifdef ASYNC_LOADING_DEBUG_OUTPUTA OutputDebugLine("[AsyncLoading] FreezeUntilCollisionLoaded - Early stop"); - #endif + #endif return; } diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaDefs.h b/Client/mods/deathmatch/logic/luadefs/CLuaDefs.h index f89ce786dea..d533baef6c1 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaDefs.h +++ b/Client/mods/deathmatch/logic/luadefs/CLuaDefs.h @@ -9,7 +9,7 @@ *****************************************************************************/ #pragma once -#define LUA_DECLARE(x) static int x ( lua_State * luaVM ); +#define LUA_DECLARE(x) static int x ( lua_State * luaVM ); #define LUA_DECLARE_OOP(x) LUA_DECLARE(x) LUA_DECLARE(OOP_##x) class CClientColManager; diff --git a/Client/multiplayer_sa/CMultiplayerSA.cpp b/Client/multiplayer_sa/CMultiplayerSA.cpp index 1d2930ef517..824a2abb2a9 100644 --- a/Client/multiplayer_sa/CMultiplayerSA.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA.cpp @@ -2335,8 +2335,8 @@ void _declspec(naked) HOOK_FindPlayerCoors() mov eax, edi movsd movsd - movsd - retn + movsd + retn // Continue. Don't replace the world center. dontset: @@ -2499,7 +2499,7 @@ void _declspec(naked) HOOK_FindPlayerCentreOfWorld() mov edx, CMultiplayerSA::HOOKPOS_FindPlayerCentreOfWorld add edx, 6 jmp edx - + hascenter: lea eax, vecCenterOfWorld @@ -2697,7 +2697,7 @@ void _declspec(naked) HOOK_CExplosion_AddExplosion() // If they are, just return now retn - + // Check the explosion handler. So we can call it if it exists. Jump over the explosion // handler part if we have none checkexplosionhandler: @@ -2836,7 +2836,7 @@ void _declspec(naked) HOOK_CTaskComplexJump__CreateSubTask() popad mov eax, 0x67DAD1 jmp eax - } + } } } @@ -2921,9 +2921,9 @@ void _declspec(naked) HOOK_FxManager_DestroyFxSystem() popad // The original code we replaced - push ecx - push ebx - push edi + push ecx + push ebx + push edi mov edi, [esp+10h] // Jump back to the rest of the function we hooked @@ -2975,7 +2975,7 @@ void _declspec(naked) HOOK_Render3DStuff() { _asm { - pushad + pushad } if (m_pRender3DStuffHandler) m_pRender3DStuffHandler(); @@ -3456,7 +3456,7 @@ void _declspec(naked) HOOK_CObject_Render() _asm { mov dwAlphaEntity, ecx - pushad + pushad } TIMING_CHECKPOINT("+ObjRndr"); @@ -3966,7 +3966,7 @@ void _declspec(naked) HOOK_CTrafficLights_GetPrimaryLightState() { _asm { - pushad + pushad } if (ucTrafficLightState == 0 || ucTrafficLightState == 5 || ucTrafficLightState == 8) @@ -3995,7 +3995,7 @@ void _declspec(naked) HOOK_CTrafficLights_GetSecondaryLightState() { _asm { - pushad + pushad } if (ucTrafficLightState == 3 || ucTrafficLightState == 5 || ucTrafficLightState == 7) @@ -4024,7 +4024,7 @@ void _declspec(naked) HOOK_CTrafficLights_DisplayActualLight() { _asm { - pushad + pushad } if (ucTrafficLightState == 2) @@ -4416,7 +4416,7 @@ void _declspec(naked) HOOK_VehicleCamUp() cmp al, 2 // Is it a vehicle? jz docustom - + mov ecx, edx mov eax, 0x509CE0 // CCam::GetVectorsReadyForRW jmp eax @@ -4756,8 +4756,8 @@ void _declspec(naked) HOOK_CVehicle_DoVehicleLights() _asm { mov pLightsVehicleInterface, ecx - mov al,byte ptr ds:[00C1CC18h] - sub esp,3Ch + mov al,byte ptr ds:[00C1CC18h] + sub esp,3Ch jmp RETURN_CVehicle_DoVehicleLights } } @@ -4786,7 +4786,7 @@ void _declspec(naked) HOOK_CVehicle_DoHeadLightBeam_1() mov pHeadLightBeamVehicleInterface, ecx sub esp, 94h jmp RETURN_CVehicle_DoHeadLightBeam_1 - } + } } RwVertex* pHeadLightVerts = NULL; @@ -4810,7 +4810,7 @@ void _declspec(naked) HOOK_CVehicle_DoHeadLightBeam_2() mov eax, [esp] mov pHeadLightVerts, eax mov eax, [esp+4] - mov uiHeadLightNumVerts, eax + mov uiHeadLightNumVerts, eax pushad } @@ -4819,7 +4819,7 @@ void _declspec(naked) HOOK_CVehicle_DoHeadLightBeam_2() _asm { popad - mov dword ptr ds:[0C4B950h],5 + mov dword ptr ds:[0C4B950h],5 jmp RETURN_CVehicle_DoHeadLightBeam_2 } } @@ -4829,7 +4829,7 @@ void _declspec(naked) HOOK_CVehicle_DoHeadLightEffect_1() { _asm { - pushad + pushad } CVehicle_GetHeadLightColor(pLightsVehicleInterface, 160.0f, 160.0f, 140.0f); @@ -4846,7 +4846,7 @@ void _declspec(naked) HOOK_CVehicle_DoHeadLightEffect_1() //mov eax, ulHeadLightA //mov [esp+20], eax - call dwCCoronas_RegisterCorona + call dwCCoronas_RegisterCorona add esp,54h jmp RETURN_CVehicle_DoHeadLightEffect_1 } @@ -4856,7 +4856,7 @@ void _declspec(naked) HOOK_CVehicle_DoHeadLightEffect_2() { _asm { - pushad + pushad } CVehicle_GetHeadLightColor(pLightsVehicleInterface, 160.0f, 160.0f, 140.0f); @@ -4873,7 +4873,7 @@ void _declspec(naked) HOOK_CVehicle_DoHeadLightEffect_2() //mov eax, ulHeadLightA //mov [esp+20], eax - call dwCCoronas_RegisterCorona + call dwCCoronas_RegisterCorona add esp, 54h jmp RETURN_CVehicle_DoHeadLightEffect_2 } @@ -4884,7 +4884,7 @@ void _declspec(naked) HOOK_CVehicle_DoHeadLightReflectionTwin() { _asm { - pushad + pushad } CVehicle_GetHeadLightColor(pLightsVehicleInterface, 45.0f, 45.0f, 45.0f); @@ -4902,14 +4902,14 @@ void _declspec(naked) HOOK_CVehicle_DoHeadLightReflectionTwin() call dwCShadows_StoreCarLightShadow add esp, 4Ch jmp RETURN_CVehicle_DoHeadLightReflectionTwin - } + } } void _declspec(naked) HOOK_CVehicle_DoHeadLightReflectionSingle() { _asm { - pushad + pushad } CVehicle_GetHeadLightColor(pLightsVehicleInterface, 45.0f, 45.0f, 45.0f); @@ -4972,7 +4972,7 @@ void _declspec(naked) HOOK_CFire_ProcessFire() call eax test eax, eax jz fail - mov ecx, [esi+0x14] + mov ecx, [esi+0x14] mov [eax+0x14], ecx fail: jmp RETURN_CFire_ProcessFire @@ -5103,7 +5103,7 @@ void _declspec(naked) HOOK_RenderScene_Plants() pushad call CPlantMgr_Render_Pre popad - + push 1 // bRenderingBeforeWater movzx eax, bl // bCamBelowWater push eax @@ -5168,7 +5168,7 @@ void _declspec(naked) HOOK_CPlantMgr_Render() add esp, 4 test al, al jnz watercheck // only compare plant.z to water level if there actually is water here - + xor eax, eax // if there's no water, assume "plant above water" jmp rendercheck @@ -5177,7 +5177,7 @@ void _declspec(naked) HOOK_CPlantMgr_Render() push [ebp+8] call IsPlantBelowWater add esp, 8 - + rendercheck: xor eax, [esp+0x88+4] // Decide whether or not to draw the plant right now cmp eax, [esp+0x88+8] @@ -5244,7 +5244,7 @@ AnimationId animationID = 0; void _declspec(naked) HOOK_CAnimManager_AddAnimation() { _asm - { + { mov eax, [esp+4] mov animationClump, eax mov eax, [esp+8] @@ -5262,8 +5262,8 @@ void _declspec(naked) HOOK_CAnimManager_AddAnimation() _asm { popad - mov eax,dword ptr [esp+0Ch] - mov edx,dword ptr ds:[0B4EA34h] + mov eax,dword ptr [esp+0Ch] + mov edx,dword ptr ds:[0B4EA34h] jmp RETURN_CAnimManager_AddAnimation } } @@ -5272,7 +5272,7 @@ float animationBlendDelta; void _declspec(naked) HOOK_CAnimManager_BlendAnimation() { _asm - { + { mov eax, [esp+4] mov animationClump, eax mov eax, [esp+8] @@ -5292,7 +5292,7 @@ void _declspec(naked) HOOK_CAnimManager_BlendAnimation() _asm { popad - sub esp,14h + sub esp,14h mov ecx,dword ptr [esp+18h] jmp RETURN_CAnimManager_BlendAnimation } @@ -5598,9 +5598,9 @@ void _declspec(naked) HOOK_VehCol() mov dl, 3 mov al, 2 mov cl, 1 - push edx - xor edx,edx - mov dl,byte ptr [esi+434h] + push edx + xor edx,edx + mov dl,byte ptr [esi+434h] mov dl, 0 jmp RETURN_VehCol // 006D660C @@ -5614,13 +5614,13 @@ void _declspec(naked) HOOK_VehColCB() // Hooked from 004C838D 29 bytes // Apply vehColors for this vehicle - mov cl,byte ptr [esi*4+vehColors.R] + mov cl,byte ptr [esi*4+vehColors.R] mov byte ptr [eax+4],cl - mov cl,byte ptr [esi*4+vehColors.G] + mov cl,byte ptr [esi*4+vehColors.G] mov byte ptr [eax+5],cl - mov cl,byte ptr [esi*4+vehColors.B] + mov cl,byte ptr [esi*4+vehColors.B] mov byte ptr [eax+6],cl jmp RETURN_VehColCB // 004C83AA @@ -5741,7 +5741,7 @@ void _declspec(naked) HOOK_ProcessVehicleCollision() pop edx push eax - + push edx push esi call SetModelSuspensionLines @@ -6512,7 +6512,7 @@ void _declspec(naked) HOOK_CGlass_WindowRespondsToCollision() _asm { popad - + sub esp, 68h push esi mov esi, [esp+6Ch+4] @@ -6830,7 +6830,7 @@ void _declspec(naked) HOOK_CAERadioTrackManager__ChooseMusicTrackIndex() { // pop the stack popad - // this number of tracks needs fixing because we need the game to know about the deletions here as it is used for the wrap around logic of radio + // this number of tracks needs fixing because we need the game to know about the deletions here as it is used for the wrap around logic of radio mov ecx, dwNumberOfTracks // jump back to normal processing jmp RETURN_CAERadioTrackManager__ChooseMusicTrackIndex diff --git a/Client/multiplayer_sa/CMultiplayerSA_1.3.cpp b/Client/multiplayer_sa/CMultiplayerSA_1.3.cpp index 83246d69fc2..3b838b806f8 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_1.3.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_1.3.cpp @@ -583,7 +583,7 @@ void _declspec(naked) HOOK_CVehicle_ProcessStuff_PostPushSirenPositionSingle() push eax mov eax, dwRed push eax - + // return back to SA JMP RETN_CVehicle_ProcessStuff_PostPushSirenPositionSingle } @@ -623,7 +623,7 @@ void _declspec(naked) HOOK_CVehicle_ProcessStuff_TestSirenTypeDual() { _asm { - // Grab our default siren type into edi + // Grab our default siren type into edi movzx edi, byte ptr ds:[edi+06ACDACh] pushad // Store our Vehicle interface @@ -794,7 +794,7 @@ void _declspec(naked) HOOK_CVehicle_DoesVehicleUseSiren() { _asm { - popad + popad // Move 1 into AL (true) mov al, 1 // Return diff --git a/Client/multiplayer_sa/CMultiplayerSA_ClothesCache.cpp b/Client/multiplayer_sa/CMultiplayerSA_ClothesCache.cpp index 85bbc45b2d0..f175a627f35 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_ClothesCache.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_ClothesCache.cpp @@ -383,7 +383,7 @@ void _declspec(naked) HOOK_CClothesBuilderCreateSkinnedClump() inside: // Original code - sub esp, 0D4h + sub esp, 0D4h jmp RETURN_CClothesBuilderCreateSkinnedClump } } diff --git a/Client/multiplayer_sa/CMultiplayerSA_ClothesSpeedUp.cpp b/Client/multiplayer_sa/CMultiplayerSA_ClothesSpeedUp.cpp index 09cc57ef426..512f3e322be 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_ClothesSpeedUp.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_ClothesSpeedUp.cpp @@ -87,7 +87,7 @@ void _declspec(naked) HOOK_LoadingPlayerImgDir() popad // Standard code to load img directory - push 0BBCDC8h + push 0BBCDC8h jmp RETURN_LoadingPlayerImgDirA // Skip loading img directory diff --git a/Client/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp b/Client/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp index d484dd260dc..6b6b78fe97e 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp @@ -30,7 +30,7 @@ void _declspec(naked) CrashAverted() call OnCrashAverted add esp, 4 popad - popfd + popfd retn 4 } } @@ -44,10 +44,10 @@ void _declspec(naked) HOOK_CrashFix_Misc1() _asm { mov eax,dword ptr [esp+18h] - test eax,eax + test eax,eax je cont - mov eax,dword ptr ds:[008D12CCh] + mov eax,dword ptr ds:[008D12CCh] mov ecx,dword ptr [eax+esi] // If [eax+esi] is 0, it causes a crash test ecx,ecx jne cont @@ -68,23 +68,23 @@ void _declspec(naked) HOOK_CrashFix_Misc2() { _asm { - test eax,eax + test eax,eax je cont // Skip much code if eax is zero (vehicle has no colmodel) - mov eax,dword ptr [eax+2Ch] + mov eax,dword ptr [eax+2Ch] - test eax,eax + test eax,eax je cont // Skip much code if eax is zero (colmodel has no coldata) - mov ebx,dword ptr [eax+10h] + mov ebx,dword ptr [eax+10h] - test ebx,ebx + test ebx,ebx je cont // Skip much code if ebx is zero (coldata has no suspension lines) mov cl,byte ptr [esi+429h] jmp RETURN_CrashFix_Misc2 cont: - push 2 + push 2 call CrashAverted jmp RETURN_CrashFix_Misc2B } @@ -98,13 +98,13 @@ void _declspec(naked) HOOK_CrashFix_Misc3() { _asm { - test ecx,ecx + test ecx,ecx je cont // Skip much code if ecx is zero (ped has no something) mov edx,dword ptr [ecx+384h] jmp RETURN_CrashFix_Misc3 cont: - push 3 + push 3 call CrashAverted jmp CPlayerPed__ProcessControl_Abort } @@ -119,15 +119,15 @@ void _declspec(naked) HOOK_CrashFix_Misc4() { _asm { - test ecx,ecx + test ecx,ecx je cont // Skip much code if ecx is zero (avoid divide by zero in soundmanager::service) - cdq - idiv ecx - add edx, ebp + cdq + idiv ecx + add edx, ebp jmp RETURN_CrashFix_Misc4 cont: - push 4 + push 4 call CrashAverted jmp RETURN_CrashFix_Misc4B } @@ -143,14 +143,14 @@ void _declspec(naked) HOOK_CrashFix_Misc5() _asm { mov edi, dword ptr [ecx*4+0A9B0C8h] - mov edi, dword ptr [edi+5Ch] - test edi, edi + mov edi, dword ptr [edi+5Ch] + test edi, edi je cont // Skip much code if edi is zero (ped has no model) mov edi, dword ptr [ecx*4+0A9B0C8h] jmp RETURN_CrashFix_Misc5 cont: - push 5 + push 5 call CrashAverted pop edi jmp RETURN_CrashFix_Misc5B @@ -167,14 +167,14 @@ void _declspec(naked) HOOK_CrashFix_Misc6() { _asm { - test ecx, ecx + test ecx, ecx je cont // Skip much code if ecx is zero (ped has no anim something) mov eax, dword ptr [ecx+10h] test eax, eax jmp RETURN_CrashFix_Misc6 cont: - push 6 + push 6 call CrashAverted jmp RETURN_CrashFix_Misc6B } @@ -190,14 +190,14 @@ void _declspec(naked) HOOK_CrashFix_Misc7() { _asm { - test ecx, ecx + test ecx, ecx je cont // Skip much code if ecx is zero (no colmodel) - mov esi, dword ptr [ecx+2Ch] + mov esi, dword ptr [ecx+2Ch] test esi, esi jmp RETURN_CrashFix_Misc7 cont: - push 7 + push 7 call CrashAverted jmp RETURN_CrashFix_Misc7B } @@ -213,14 +213,14 @@ void _declspec(naked) HOOK_CrashFix_Misc8() { _asm { - test ecx, ecx + test ecx, ecx je cont // Skip much code if ecx is zero (no 2d effect plugin) - mov ecx, dword ptr [edx+ecx] - test ecx, ecx + mov ecx, dword ptr [edx+ecx] + test ecx, ecx jmp RETURN_CrashFix_Misc8 cont: - push 8 + push 8 call CrashAverted jmp RETURN_CrashFix_Misc8B } @@ -236,14 +236,14 @@ void _declspec(naked) HOOK_CrashFix_Misc9() { _asm { - test esi, esi + test esi, esi je cont // Skip much code if esi is zero (invalid projectile) - mov eax, dword ptr [esi+40h] + mov eax, dword ptr [esi+40h] test ah, 1 jmp RETURN_CrashFix_Misc9 cont: - push 9 + push 9 call CrashAverted jmp RETURN_CrashFix_Misc9B } @@ -262,11 +262,11 @@ void _declspec(naked) HOOK_CrashFix_Misc10() cmp ecx, 0x80 jb cont // Skip much code if ecx is small (invalid vector pointer) - mov edx, dword ptr [ecx] + mov edx, dword ptr [ecx] mov dword ptr [esp], edx jmp RETURN_CrashFix_Misc10 cont: - push 10 + push 10 call CrashAverted mov ecx, dword ptr [esp+1Ch] mov dword ptr [ecx],0 @@ -286,14 +286,14 @@ void _declspec(naked) HOOK_CrashFix_Misc11() { _asm { - test ecx, ecx + test ecx, ecx je cont // Skip much code if ecx is zero (invalid anim somthing) - mov eax, dword ptr [ecx+10h] - test eax, eax + mov eax, dword ptr [ecx+10h] + test eax, eax jmp RETURN_CrashFix_Misc11 cont: - push 11 + push 11 call CrashAverted jmp RETURN_CrashFix_Misc11B } @@ -309,14 +309,14 @@ void _declspec(naked) HOOK_CrashFix_Misc12() { _asm { - test edi, edi + test edi, edi je cont // Skip much code if edi is zero (invalid anim somthing) - mov al, byte ptr [edi+0Bh] - test al, al + mov al, byte ptr [edi+0Bh] + test al, al jmp RETURN_CrashFix_Misc12 cont: - push 12 + push 12 call CrashAverted jmp RETURN_CrashFix_Misc12B } @@ -334,11 +334,11 @@ void _declspec(naked) HOOK_CrashFix_Misc13() cmp eax, 0x2480 jb cont // Skip much code if eax is less than 0x480 (invalid anim) - mov al, byte ptr [eax+0Ah] + mov al, byte ptr [eax+0Ah] shr al, 5 jmp RETURN_CrashFix_Misc13 cont: - push 13 + push 13 call CrashAverted jmp RETURN_CrashFix_Misc13B } @@ -359,7 +359,7 @@ void _declspec(naked) HOOK_CrashFix_Misc14() sub esp, 0D4h jmp RETURN_CrashFix_Misc14 cont: - push 14 + push 14 call CrashAverted add esp, 12 retn 12 @@ -432,7 +432,7 @@ void _declspec(naked) HOOK_CrashFix_Misc16() jmp RETURN_CrashFix_Misc16 cont: - push 16 + push 16 call CrashAverted add esp, 96 retn @@ -463,7 +463,7 @@ void _declspec(naked) HOOK_CrashFix_Misc17() jmp RETURN_CrashFix_Misc17_BOTH cont: - push 17 + push 17 call CrashAverted jmp RETURN_CrashFix_Misc17B_BOTH } @@ -482,21 +482,21 @@ void _declspec(naked) HOOK_CrashFix_Misc18() je cont // Skip much code if ebp is zero // continue standard path - mov edx,dword ptr [ebp+40h] - mov eax,dword ptr [esp+10h] + mov edx,dword ptr [ebp+40h] + mov eax,dword ptr [esp+10h] jmp RETURN_CrashFix_Misc18 cont: - push 18 + push 18 call CrashAverted - mov edx,0 + mov edx,0 mov eax,dword ptr [esp+10h] - mov dword ptr [eax],edx - mov dword ptr [eax+4],edx - pop esi - mov dword ptr [eax+8],edx - pop ebp - ret 0Ch + mov dword ptr [eax],edx + mov dword ptr [eax+4],edx + pop esi + mov dword ptr [eax+8],edx + pop ebp + ret 0Ch } } @@ -520,13 +520,13 @@ void _declspec(naked) HOOK_CrashFix_Misc19() je cont // Skip much code if esi is zero // continue standard path - mov eax, [esi+98h] + mov eax, [esi+98h] jmp RETURN_CrashFix_Misc19_BOTH cont: - push 19 + push 19 call CrashAverted - mov edx,dword ptr [ecx+98h] + mov edx,dword ptr [ecx+98h] test edx,edx jmp RETURN_CrashFix_Misc19B_BOTH } @@ -545,12 +545,12 @@ void _declspec(naked) HOOK_CrashFix_Misc20() je cont // Skip much code if ecx is zero // continue standard path - sub esp, 10h - mov eax, [ecx+14h] + sub esp, 10h + mov eax, [ecx+14h] jmp RETURN_CrashFix_Misc20 cont: - push 20 + push 20 call CrashAverted retn } @@ -607,7 +607,7 @@ void _declspec(naked) HOOK_CrashFix_Misc21() jmp RETURN_CrashFix_Misc21 cont: - push 21 + push 21 call CrashAverted retn } @@ -622,39 +622,39 @@ void _declspec(naked) HOOK_CrashFix_Misc22() { _asm { - mov edx,dword ptr [edi+0Ch] + mov edx,dword ptr [edi+0Ch] cmp edx, 0x480 jb altcode // Fill output with zeros if edx is low // do standard code lp1: - mov edx,dword ptr [edi+0Ch] - mov edx,dword ptr [edx+eax*4] - mov ebx,dword ptr [esi+10h] - mov dword ptr [ebx+ecx+10h],edx - mov edx,dword ptr [esi+10h] - mov dword ptr [edx+ecx+14h],esi - movsx edx,word ptr [esi+0Ch] - inc eax - add ecx,18h - cmp eax,edx - jl lp1 + mov edx,dword ptr [edi+0Ch] + mov edx,dword ptr [edx+eax*4] + mov ebx,dword ptr [esi+10h] + mov dword ptr [ebx+ecx+10h],edx + mov edx,dword ptr [esi+10h] + mov dword ptr [edx+ecx+14h],esi + movsx edx,word ptr [esi+0Ch] + inc eax + add ecx,18h + cmp eax,edx + jl lp1 jmp RETURN_CrashFix_Misc22 // do alternate code altcode: - push 22 + push 22 call CrashAverted mov edx,0 - mov ebx,dword ptr [esi+10h] - mov dword ptr [ebx+ecx+10h],edx - mov dword ptr [ebx+ecx+14h],edx - movsx edx,word ptr [esi+0Ch] - inc eax - add ecx,18h - cmp eax,edx - jl altcode + mov ebx,dword ptr [esi+10h] + mov dword ptr [ebx+ecx+10h],edx + mov dword ptr [ebx+ecx+14h],edx + movsx edx,word ptr [esi+0Ch] + inc eax + add ecx,18h + cmp eax,edx + jl altcode jmp RETURN_CrashFix_Misc22 } } @@ -676,7 +676,7 @@ void _declspec(naked) HOOK_CrashFix_Misc23() // zero if out of range mov edx,0 mov [esp+8], edx - push 23 + push 23 call CrashAverted ok: @@ -708,7 +708,7 @@ void _declspec(naked) HOOK_CrashFix_Misc24() jmp RETURN_CrashFix_Misc24_BOTH cont: - push 24 + push 24 call CrashAverted mov ebp, 0 mov eax, 0 @@ -736,7 +736,7 @@ void _declspec(naked) HOOK_CrashFix_Misc25() jmp RETURN_CrashFix_Misc25 fix: - push 25 + push 25 call CrashAverted // Do special thing pop esi @@ -759,18 +759,18 @@ void _declspec(naked) HOOK_CrashFix_Misc26() jz fix // Continue standard path - mov edi,dword ptr [ebx+ebp*4] - dec ebp - test edi,edi + mov edi,dword ptr [ebx+ebp*4] + dec ebp + test edi,edi jmp RETURN_CrashFix_Misc26 fix: - push 26 + push 26 call CrashAverted // Do special thing - mov edi, 0 - dec ebp - test edi,edi + mov edi, 0 + dec ebp + test edi,edi jmp RETURN_CrashFix_Misc26 } } @@ -792,7 +792,7 @@ void _declspec(naked) HOOK_CrashFix_Misc27() mov ecx, [edi+58Ch] test ecx, ecx jne cont - push 27 + push 27 call CrashAverted cont: @@ -818,7 +818,7 @@ void _declspec(naked) HOOK_CrashFix_Misc28() test eax, eax jne cont - push 28 + push 28 call CrashAverted // Skip much code jmp RETURN_CrashFix_Misc28B @@ -850,7 +850,7 @@ void _declspec(naked) HOOK_CrashFix_Misc29() jmp RETURN_CrashFix_Misc29 cont: - push 29 + push 29 call CrashAverted // Skip much code jmp RETURN_CrashFix_Misc29B @@ -878,7 +878,7 @@ void _declspec(naked) HOOK_CrashFix_Misc30() jmp RETURN_CrashFix_Misc30 cont: - push 30 + push 30 call CrashAverted // Skip much code jmp RETURN_CrashFix_Misc30B @@ -987,8 +987,8 @@ void _declspec(naked) HOOK_CClumpModelInfo_GetFrameFromId() retn inner: - sub esp,8 - mov eax,dword ptr [esp+10h] + sub esp,8 + mov eax,dword ptr [esp+10h] jmp RETURN_CClumpModelInfo_GetFrameFromId } } @@ -1066,7 +1066,7 @@ void _declspec(naked) HOOK_CEntity_GetBoundRect() popad // Continue replaced code - mov ecx,dword ptr [eax*4+0A9B0C8h] + mov ecx,dword ptr [eax*4+0A9B0C8h] jmp RETURN_CEntity_GetBoundRect } } @@ -1220,8 +1220,8 @@ void _declspec(naked) HOOK_CVolumetricShadowMgr_Render() inner: // Replaced code - sub esp, 18h - mov ecx, 0A9AE00h + sub esp, 18h + mov ecx, 0A9AE00h jmp RETURN_CVolumetricShadowMgr_Render } } @@ -1268,7 +1268,7 @@ void _declspec(naked) HOOK_CVolumetricShadowMgr_Update() inner: // Replaced code - mov ecx, 0A9AE00h + mov ecx, 0A9AE00h jmp RETURN_CVolumetricShadowMgr_Update } } @@ -1310,7 +1310,7 @@ void _declspec(naked) HOOK_CAnimManager_CreateAnimAssocGroups() popad // Replaced code - mov eax, 0x0A9B0C8[eax*4] + mov eax, 0x0A9B0C8[eax*4] jmp RETURN_CAnimManager_CreateAnimAssocGroups } } @@ -1438,11 +1438,11 @@ void _declspec(naked) HOOK_RwMatrixMultiply() cmp eax, 0x480 jb cont // Skip code if eax is low - mov ecx, dword ptr ds:[0C979BCh] + mov ecx, dword ptr ds:[0C979BCh] jmp RETURN_RwMatrixMultiply_BOTH cont: - push 31 + push 31 call CrashAverted retn } diff --git a/Client/multiplayer_sa/CMultiplayerSA_Direct3D.cpp b/Client/multiplayer_sa/CMultiplayerSA_Direct3D.cpp index e7ed89d2e29..59da538bd8a 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_Direct3D.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_Direct3D.cpp @@ -62,15 +62,15 @@ void _declspec(naked) HOOK_PreCreateDevice() _asm { // Run replaced code - mov ecx,dword ptr ds:[0C97C20h] - push 0C97C28h - push 0C9C040h - push eax + mov ecx,dword ptr ds:[0C97C20h] + push 0C97C28h + push 0C9C040h + push eax mov eax,dword ptr ds:[00C97C1Ch] - mov edx, [ecx] - push eax + mov edx, [ecx] + push eax mov eax,dword ptr ds:[008E2428h] - push eax + push eax mov eax, ds:0x0C97C24 // __RwD3DAdapterIndex push eax diff --git a/Client/multiplayer_sa/CMultiplayerSA_Files.cpp b/Client/multiplayer_sa/CMultiplayerSA_Files.cpp index 439019c8340..4a563a9dc7a 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_Files.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_Files.cpp @@ -74,7 +74,7 @@ void _declspec(naked) HOOK_Rtl_fopen() inner: push 40h - push [esp+0x0c] + push [esp+0x0c] jmp RETURN_Rtl_fopen_BOTH } } @@ -112,7 +112,7 @@ void _declspec(naked) HOOK_Rtl_fclose() popad push 0Ch - push 0x887EC8 + push 0x887EC8 jmp RETURN_Rtl_fclose_BOTH } } diff --git a/Client/multiplayer_sa/CMultiplayerSA_FixLineOfSightArgs.cpp b/Client/multiplayer_sa/CMultiplayerSA_FixLineOfSightArgs.cpp index 6a391262d91..cc32a4d7936 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_FixLineOfSightArgs.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_FixLineOfSightArgs.cpp @@ -62,8 +62,8 @@ void _declspec(naked) HOOK_CWorld_ProcessLineOfSight() add esp, 4*2 popad - sub esp, 60h - cmp word ptr ds:[0B7CD78h], 0FFFFh + sub esp, 60h + cmp word ptr ds:[0B7CD78h], 0FFFFh jmp RETURN_CWorld_ProcessLineOfSight } } diff --git a/Client/multiplayer_sa/CMultiplayerSA_ObjectLODSystem.cpp b/Client/multiplayer_sa/CMultiplayerSA_ObjectLODSystem.cpp index e9d12c4ec8c..1951d655bf3 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_ObjectLODSystem.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_ObjectLODSystem.cpp @@ -117,9 +117,9 @@ void _declspec(naked) HOOK_CRenderer_SetupEntityVisibility() retn second: - sub esp,14h - push esi - mov esi,dword ptr [esp+1Ch] + sub esp,14h + push esi + mov esi,dword ptr [esp+1Ch] jmp RETURN_CRenderer_SetupEntityVisibility // 0x554238 } } diff --git a/Client/multiplayer_sa/CMultiplayerSA_Rendering.cpp b/Client/multiplayer_sa/CMultiplayerSA_Rendering.cpp index c7946745223..b9d628d8957 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_Rendering.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_Rendering.cpp @@ -131,10 +131,10 @@ void _declspec(naked) HOOK_CEntity_Render() retn inner: - push ecx - push esi - mov esi,ecx - mov eax,dword ptr [esi+18h] + push ecx + push esi + mov esi,ecx + mov eax,dword ptr [esi+18h] jmp RETURN_CEntity_Render } } @@ -191,7 +191,7 @@ void _declspec(naked) HOOK_CEntity_RenderOneNonRoad() retn inner: - push esi + push esi mov esi, [esp+08h] jmp RETURN_CEntity_RenderOneNonRoad } @@ -253,8 +253,8 @@ void _declspec(naked) HOOK_CVisibilityPlugins_RenderWeaponPedsForPC_End() popad // Continue original code - pop esi - add esp,0Ch + pop esi + add esp,0Ch ret } } diff --git a/Client/multiplayer_sa/CMultiplayerSA_Weapons.cpp b/Client/multiplayer_sa/CMultiplayerSA_Weapons.cpp index 6780fde552e..05a655e3fc4 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_Weapons.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_Weapons.cpp @@ -69,8 +69,8 @@ void _declspec(naked) HOOK_CWeapon_GenerateDamageEvent() add esp, 4*6+4 popad - push 0FFFFFFFFh - push 848E10h + push 0FFFFFFFFh + push 848E10h jmp RETURN_CWeapon_GenerateDamageEvent } } @@ -109,7 +109,7 @@ void Call_CShotInfo_Update(void) call inner jmp done inner: - push ebp + push ebp mov ebp, esp and esp, 0FFFFFFF8h jmp RETURN_CShotInfo_Update diff --git a/Client/multiplayer_sa/CPopulationSA.cpp b/Client/multiplayer_sa/CPopulationSA.cpp index c540c5f31c4..0317ead27e5 100644 --- a/Client/multiplayer_sa/CPopulationSA.cpp +++ b/Client/multiplayer_sa/CPopulationSA.cpp @@ -189,7 +189,7 @@ VOID _declspec(naked) HOOK_CPopulation__RemovePed() _asm { - + push esi mov esi, [esp+8] push esi diff --git a/Client/multiplayer_sa/multiplayer_keysync.h b/Client/multiplayer_sa/multiplayer_keysync.h index 47a9349e96a..629d9f7d0f1 100644 --- a/Client/multiplayer_sa/multiplayer_keysync.h +++ b/Client/multiplayer_sa/multiplayer_keysync.h @@ -43,7 +43,7 @@ VOID HOOK_CHeli__ProcessControl(); #define FUNC_CPlayerPed__ProcessControl 0x60EA90 #define VTBL_CPlayerPed__ProcessControl 0x86D190 -#define FUNC_CAutomobile__ProcessControl 0x6B1880 +#define FUNC_CAutomobile__ProcessControl 0x6B1880 #define VTBL_CAutomobile__ProcessControl 0x871148 #define FUNC_CMonsterTruck__ProcessControl 0x6C8250 @@ -64,13 +64,13 @@ VOID HOOK_CHeli__ProcessControl(); #define FUNC_CTrain__ProcessControl 0x6F86A0 #define VTBL_CTrain__ProcessControl 0x872398 -#define FUNC_CBoat__ProcessControl 0x6F1770 +#define FUNC_CBoat__ProcessControl 0x6F1770 #define VTBL_CBoat__ProcessControl 0x8721C8 -#define FUNC_CBike__ProcessControl 0x6B9250 +#define FUNC_CBike__ProcessControl 0x6B9250 #define VTBL_CBike__ProcessControl 0x871388 -#define FUNC_CHeli__ProcessControl 0x6C7050 +#define FUNC_CHeli__ProcessControl 0x6C7050 #define VTBL_CHeli__ProcessControl 0x8716A8 //#define FUNC_CVehicle__ProcessUnknown 0x593030 diff --git a/Client/multiplayer_sa/multiplayer_shotsync.cpp b/Client/multiplayer_sa/multiplayer_shotsync.cpp index 5e3461ccf92..fb2f23c7add 100644 --- a/Client/multiplayer_sa/multiplayer_shotsync.cpp +++ b/Client/multiplayer_sa/multiplayer_shotsync.cpp @@ -303,8 +303,8 @@ VOID _declspec(naked) HOOK_CTaskSimpleUsegun_ProcessPed() mov pAPed, eax // Replace original code - push 0FFFFFFFFh - mov eax,dword ptr fs:[00000000h] + push 0FFFFFFFFh + mov eax,dword ptr fs:[00000000h] // Jump back to func. I think we can use EDX here mov edx, HOOKPOS_CTaskSimpleUsegun_ProcessPed @@ -437,8 +437,8 @@ VOID _declspec(naked) HOOK_IKChainManager_PointArm() popad // Run the instructions we replaced when this hook was added - push 0FFFFFFFFh - push 83F0D6h + push 0FFFFFFFFh + push 83F0D6h // Continue execution where we intercepted mov edx, HOOKPOS_IKChainManager_PointArm @@ -502,8 +502,8 @@ VOID _declspec(naked) HOOK_IKChainManager_LookAt() popad // Run the instructions we replaced when this hook was added - push 0FFFFFFFFh - push 83F0B6h + push 0FFFFFFFFh + push 83F0B6h // Continue execution where we intercepted mov edx, HOOKPOS_IKChainManager_LookAt @@ -529,7 +529,7 @@ VOID _declspec(naked) HOOK_CWeapon__Fire() pop ebx pushad - } + } // Weapon inaccuracy and animations problems may be fixed by blanking out the CWeapon variables nTimer and beyond. @@ -712,10 +712,10 @@ void _declspec(naked) HOOK_CWeapon__Fire_Sniper() popad mov ecx, HOOKPOS_CWeapon__Fire_Sniper add ecx, 6 - + mov eax, dword ptr [esp+0x14] test eax, eax - + jmp ecx } } @@ -767,9 +767,9 @@ void _declspec(naked) HOOK_CEventDamage__AffectsPed() _asm { - push esi - - mov esi, [esp+8] + push esi + + mov esi, [esp+8] mov affectsPed, esi // store the ped mov event, ecx // store the event pointer @@ -784,7 +784,7 @@ void _declspec(naked) HOOK_CEventDamage__AffectsPed() _asm { popad - + sub esp, 0xC // replacement code push esi mov esi, ecx @@ -1145,8 +1145,8 @@ void _declspec(naked) HOOK_CWeapon_FireInstantHit_Mid() popad // Do original code and continue - mov ecx,dword ptr [esp+14h] - push eax + mov ecx,dword ptr [esp+14h] + push eax jmp RETURN_CWeapon_FireInstantHit_Mid } } @@ -1201,8 +1201,8 @@ void _declspec(naked) HOOK_CWeapon_FireSniper_Mid() _asm { // Do original code - fstp dword ptr [esp+4Ch] - fstp dword ptr [esp+50h] + fstp dword ptr [esp+4Ch] + fstp dword ptr [esp+50h] pushad @@ -1303,25 +1303,25 @@ void _declspec(naked) HOOK_CWeapon_FireInstantHit() */ _asm { - push 1 - push 0 - push 0 - push 1 - push 1 - push 1 - push 1 - push 1 + push 1 + push 0 + push 0 + push 1 + push 1 + push 1 + push 1 + push 1 lea eax,[esp+58h] mov ppInstantHitEntity, eax - push eax + push eax lea ecx,[esp+0C4h] mov ppInstantHitColPoint, ecx - push ecx + push ecx lea edx,[esp+48h] mov pInstantHitEnd, edx lea eax,[esp+64h] mov pInstantHitStart, eax - push edx + push edx push eax pushad } @@ -1504,23 +1504,23 @@ VOID _declspec(naked) HOOK_CCamera__Find3rdPersonCamTargetVector() pushad } - + if(IsNotInLocalContext() && GetContextSwitchPedID()) { // its a remote player, so replace the data with the net data - sprintf(szDebug, "Switched Target Vectors to %f %f %f", - RemotePlayerTargetVectors[GetContextSwitchPedID()].fX, - RemotePlayerTargetVectors[GetContextSwitchPedID()].fY, + sprintf(szDebug, "Switched Target Vectors to %f %f %f", + RemotePlayerTargetVectors[GetContextSwitchPedID()].fX, + RemotePlayerTargetVectors[GetContextSwitchPedID()].fY, RemotePlayerTargetVectors[GetContextSwitchPedID()].fZ); OutputDebugString(szDebug); - sprintf(szDebug, "Switched Start Vectors to %f %f %f", - RemotePlayerStartVectors[GetContextSwitchPedID()].fX, - RemotePlayerStartVectors[GetContextSwitchPedID()].fY, + sprintf(szDebug, "Switched Start Vectors to %f %f %f", + RemotePlayerStartVectors[GetContextSwitchPedID()].fX, + RemotePlayerStartVectors[GetContextSwitchPedID()].fY, RemotePlayerStartVectors[GetContextSwitchPedID()].fZ); OutputDebugString(szDebug); - - + + MemCpy (vecTargetVector, &RemotePlayerTargetVectors[GetContextSwitchPedID()], sizeof(CVector)); MemCpy (vecStartVector, &RemotePlayerStartVectors[GetContextSwitchPedID()], sizeof(CVector)); } @@ -1529,23 +1529,23 @@ VOID _declspec(naked) HOOK_CCamera__Find3rdPersonCamTargetVector() // Its the Local Player, so save the data so it can be sent MemCpy (&LocalPlayerShotOriginVector, vecShotOrigin, sizeof(CVector)); - sprintf(szDebug, "Saved Local Shot Origin Vector %f %f %f", - LocalPlayerShotOriginVector.fX, - LocalPlayerShotOriginVector.fY, + sprintf(szDebug, "Saved Local Shot Origin Vector %f %f %f", + LocalPlayerShotOriginVector.fX, + LocalPlayerShotOriginVector.fY, LocalPlayerShotOriginVector.fZ); OutputDebugString(szDebug);*/ /* MemCpy (&LocalPlayerTargetVector, vecTargetVector, sizeof(CVector)); MemCpy (&LocalPlayerStartVector, vecStartVector, sizeof(CVector)); - - sprintf(szDebug, "Saved Local Target Vectors %f %f %f", - LocalPlayerTargetVector.fX, - LocalPlayerTargetVector.fY, + + sprintf(szDebug, "Saved Local Target Vectors %f %f %f", + LocalPlayerTargetVector.fX, + LocalPlayerTargetVector.fY, LocalPlayerTargetVector.fZ); OutputDebugString(szDebug); - sprintf(szDebug, "Saved Local Start Vectors %f %f %f", - LocalPlayerStartVector.fX, - LocalPlayerStartVector.fY, + sprintf(szDebug, "Saved Local Start Vectors %f %f %f", + LocalPlayerStartVector.fX, + LocalPlayerStartVector.fY, LocalPlayerStartVector.fZ); OutputDebugString(szDebug);*/ } @@ -1558,7 +1558,7 @@ VOID _declspec(naked) HOOK_CCamera__Find3rdPersonCamTargetVector() pop esi pop ebx retn 0x18 - } + } } VOID _declspec(naked) HOOK_CWeapon__FireShotgun() @@ -1592,9 +1592,9 @@ VOID _declspec(naked) HOOK_CWeapon__FireShotgun() pushad } - sprintf(szDebug, "Switched Cross Products to %f %f %f (0x%X)", - RemotePlayerCrossProducts[GetContextSwitchPedID()].fX, - RemotePlayerCrossProducts[GetContextSwitchPedID()].fY, + sprintf(szDebug, "Switched Cross Products to %f %f %f (0x%X)", + RemotePlayerCrossProducts[GetContextSwitchPedID()].fX, + RemotePlayerCrossProducts[GetContextSwitchPedID()].fY, RemotePlayerCrossProducts[GetContextSwitchPedID()].fZ, vecCrossProduct); OutputDebugString(szDebug); MemSet (vecCrossProduct,0,sizeof(CVector)); @@ -1620,9 +1620,9 @@ VOID _declspec(naked) HOOK_CWeapon__FireShotgun() } MemCpy (&LocalPlayerCrossProduct, vecCrossProduct, sizeof(CVector)); - sprintf(szDebug, "SHOTGUN: Saved Local Cross Product %f %f %f", - LocalPlayerCrossProduct.fX, - LocalPlayerCrossProduct.fY, + sprintf(szDebug, "SHOTGUN: Saved Local Cross Product %f %f %f", + LocalPlayerCrossProduct.fX, + LocalPlayerCrossProduct.fY, LocalPlayerCrossProduct.fZ); OutputDebugString(szDebug); } @@ -1634,7 +1634,7 @@ VOID _declspec(naked) HOOK_CWeapon__FireShotgun() mov edx, HOOKPOS_CWeapon__FireShotgun add edx, 20 jmp edx - } + } } #endif @@ -1662,7 +1662,7 @@ void _declspec(naked) HOOK_CEventVehicleExplosion__AffectsPed() pop edi setz al pop esi - + // Verify that the ped is affected cmp al, 1 jnz return_from @@ -1670,7 +1670,7 @@ void _declspec(naked) HOOK_CEventVehicleExplosion__AffectsPed() // Verify that this call is from the correct location cmp [esp], 0x4ab4c4 jnz return_from - + pushad } @@ -1678,7 +1678,7 @@ void _declspec(naked) HOOK_CEventVehicleExplosion__AffectsPed() CEventVehicleExplosion_NotifyDeathmatch(); _asm - { + { popad return_from: diff --git a/Client/sdk/game/CControllerConfigManager.h b/Client/sdk/game/CControllerConfigManager.h index 6dec8d3b586..0c5e32997ee 100644 --- a/Client/sdk/game/CControllerConfigManager.h +++ b/Client/sdk/game/CControllerConfigManager.h @@ -13,7 +13,7 @@ #define __CGAME_CONTROLLER_CONFIG_MANAGER // FROM VC, unlikely that they were changed though -#define GTA_KEY_NO_MOUSE_BUTTON 0 +#define GTA_KEY_NO_MOUSE_BUTTON 0 #define GTA_KEY_LMOUSE 1 #define GTA_KEY_MMOUSE 2 #define GTA_KEY_RMOUSE 3 @@ -117,7 +117,7 @@ #define GTA_KEY_RETURN 1045 /* Enter on main keyboard */ #define GTA_KEY_LSHIFT 1046 #define GTA_KEY_RSHIFT 1047 -#define GTA_KEY_LCONTROL 1049 +#define GTA_KEY_LCONTROL 1049 #define GTA_KEY_RCONTROL 1050 #define GTA_KEY_LMENU 1051 /* left Alt */ #define GTA_KEY_RMENU 1052 /* right Alt */ diff --git a/Client/sdk/game/Common.h b/Client/sdk/game/Common.h index 89c8265f1f4..bcfe17026d1 100644 --- a/Client/sdk/game/Common.h +++ b/Client/sdk/game/Common.h @@ -30,7 +30,7 @@ #define MAX_ENTRY_INFO_NODES ( MAX_ENTRY_INFO_NODES_MTA + 600 ) // 72600 #define MAX_POINTER_SINGLE_LINKS ( MAX_POINTER_SINGLE_LINKS_MTA + 5000 ) // 70000 #define MAX_POINTER_DOUBLE_LINKS ( MAX_POINTER_DOUBLE_LINKS_MTA + 800 ) // 74800 -#define MAX_RWOBJECT_INSTANCES 2500 +#define MAX_RWOBJECT_INSTANCES 2500 /** * Flags used to define weapon characteristics @@ -58,10 +58,10 @@ #define WEAPONTYPE_LONG_RELOAD_TIME (0x008000) // force a longer reload time! // these are area effect/shot options -#define WEAPONTYPE_SLOWS_DOWN (0x010000) // -#define WEAPONTYPE_RANDOM_SPEED (0x020000) // +#define WEAPONTYPE_SLOWS_DOWN (0x010000) // +#define WEAPONTYPE_RANDOM_SPEED (0x020000) // #define WEAPONTYPE_FORCE_FINISH_ANIM (0x040000) // force the anim to finish player after aim/fire rather than blending out -#define WEAPONTYPE_EXPANDS (0x080000) // +#define WEAPONTYPE_EXPANDS (0x080000) // enum eRadarSprite { diff --git a/Server/core/CCrashHandlerAPI.cpp b/Server/core/CCrashHandlerAPI.cpp index f7ee553bf76..b8f5ea7cff1 100644 --- a/Server/core/CCrashHandlerAPI.cpp +++ b/Server/core/CCrashHandlerAPI.cpp @@ -34,7 +34,7 @@ BOOL __stdcall SetCrashHandlerFilter(PFNCHFILTFN pFn) } #endif -#ifdef WIN_x86 +#ifdef WIN_x86 #include #include diff --git a/Server/mods/deathmatch/CServer.cpp b/Server/mods/deathmatch/CServer.cpp index 517255bde8b..5d1aadfb393 100644 --- a/Server/mods/deathmatch/CServer.cpp +++ b/Server/mods/deathmatch/CServer.cpp @@ -15,7 +15,7 @@ #include "SharedUtil.Thread.h" #include "SharedUtil.IntervalCounter.h" #include "SharedUtil.IntervalCounter.hpp" -#if defined(MTA_DEBUG) +#if defined(MTA_DEBUG) #include "SharedUtil.Tests.hpp" #endif @@ -40,7 +40,7 @@ void CServer::ServerInitialize(CServerInterface* pServerInterface) g_pServerInterface = pServerInterface; g_pNetServer = pServerInterface->GetNetwork(); g_pRealNetServer = g_pNetServer; - #if defined(MTA_DEBUG) + #if defined(MTA_DEBUG) SharedUtil_Tests(); #endif } diff --git a/Server/mods/deathmatch/logic/CBandwidthSettings.h b/Server/mods/deathmatch/logic/CBandwidthSettings.h index e9ab3ce61f7..ff99bec79ee 100644 --- a/Server/mods/deathmatch/logic/CBandwidthSettings.h +++ b/Server/mods/deathmatch/logic/CBandwidthSettings.h @@ -8,7 +8,7 @@ * Multi Theft Auto is available from http://www.multitheftauto.com/ * *****************************************************************************/ -#pragma once +#pragma once enum { diff --git a/Server/mods/deathmatch/logic/CCommon.h b/Server/mods/deathmatch/logic/CCommon.h index 27b15d8aa0a..f515b1cc5ed 100644 --- a/Server/mods/deathmatch/logic/CCommon.h +++ b/Server/mods/deathmatch/logic/CCommon.h @@ -786,7 +786,7 @@ DECLARE_ENUM(eJSONPrettyType); #define WEAPONTYPE_LONG_RELOAD_TIME (0x008000) // force a longer reload time! // these are area effect/shot options -#define WEAPONTYPE_SLOWS_DOWN (0x010000) // -#define WEAPONTYPE_RANDOM_SPEED (0x020000) // +#define WEAPONTYPE_SLOWS_DOWN (0x010000) // +#define WEAPONTYPE_RANDOM_SPEED (0x020000) // #define WEAPONTYPE_FORCE_FINISH_ANIM (0x040000) // force the anim to finish player after aim/fire rather than blending out #define WEAPONTYPE_EXPANDS (0x080000) // \ No newline at end of file diff --git a/Server/mods/deathmatch/logic/CResourceChecker.cpp b/Server/mods/deathmatch/logic/CResourceChecker.cpp index 755d831abd8..f80f0467b6d 100644 --- a/Server/mods/deathmatch/logic/CResourceChecker.cpp +++ b/Server/mods/deathmatch/logic/CResourceChecker.cpp @@ -438,7 +438,7 @@ bool CResourceChecker::CheckLuaDeobfuscateRequirements(const string& strFileCont if (bClientScript && IsLuaCompiledScript(strFileContents.c_str(), strFileContents.length())) { // Compiled client script with no version info - #if MTA_DM_VERSION < 0x135 + #if MTA_DM_VERSION < 0x135 SString strMessage("%s is invalid and will not work in future versions. Please re-compile at http://luac.mtasa.com/", strFileName.c_str()); CLogger::LogPrint(SString("WARNING: %s %s\n", strResourceName.c_str(), *strMessage)); #else diff --git a/Server/mods/deathmatch/logic/lua/CLuaFunctionDefs.h b/Server/mods/deathmatch/logic/lua/CLuaFunctionDefs.h index 0b2a0b71197..7ec84e69227 100644 --- a/Server/mods/deathmatch/logic/lua/CLuaFunctionDefs.h +++ b/Server/mods/deathmatch/logic/lua/CLuaFunctionDefs.h @@ -25,7 +25,7 @@ class CAccessControlListManager; #include "CLuaTimerManager.h" #define LUA_ERROR() lua_pushboolean ( luaVM, false ); return 0; -#define LUA_DECLARE(x) static int x ( lua_State * luaVM ); +#define LUA_DECLARE(x) static int x ( lua_State * luaVM ); extern CTimeUsMarker<20> markerLatentEvent; // For timing triggerLatentClientEvent diff --git a/Server/mods/deathmatch/logic/luadefs/CLuaDefs.h b/Server/mods/deathmatch/logic/luadefs/CLuaDefs.h index a9820fb7526..f22f1676cf7 100644 --- a/Server/mods/deathmatch/logic/luadefs/CLuaDefs.h +++ b/Server/mods/deathmatch/logic/luadefs/CLuaDefs.h @@ -49,7 +49,7 @@ #define SCRIPT_VERIFY_ACCOUNT(account) (m_pAccountManager->Exists(account)) #define SCRIPT_VERIFY_COLSHAPE(colshape) (m_pColManager->Exists(colshape)) #define SCRIPT_VERIFY_RESOURCE(resource) (m_pResourceManager->Exists(resource)) -#define LUA_DECLARE(x) static int x ( lua_State * luaVM ); +#define LUA_DECLARE(x) static int x ( lua_State * luaVM ); #define LUA_DECLARE_OOP(x) LUA_DECLARE(x) LUA_DECLARE(OOP_##x) class CLuaDefs diff --git a/Server/mods/deathmatch/utils/CZipMaker.h b/Server/mods/deathmatch/utils/CZipMaker.h index 361f5cd6ba5..199f165ac9c 100644 --- a/Server/mods/deathmatch/utils/CZipMaker.h +++ b/Server/mods/deathmatch/utils/CZipMaker.h @@ -7,7 +7,7 @@ * Multi Theft Auto is available from http://www.multitheftauto.com/ * *****************************************************************************/ -#pragma once +#pragma once class CZipMaker { diff --git a/Shared/mods/deathmatch/logic/luascripts/exports.lua.h b/Shared/mods/deathmatch/logic/luascripts/exports.lua.h index 216d1dd060e..d519233f083 100644 --- a/Shared/mods/deathmatch/logic/luascripts/exports.lua.h +++ b/Shared/mods/deathmatch/logic/luascripts/exports.lua.h @@ -38,7 +38,7 @@ function exportsMT:__index(k) elseif type(k) ~= 'string' then k = tostring(k) end - + local res = getResourceFromName(k) if res and getResourceRootElement(res) then return setmetatable({ res = res }, rescallMT) diff --git a/Shared/mods/deathmatch/logic/luascripts/inspect.lua.h b/Shared/mods/deathmatch/logic/luascripts/inspect.lua.h index 728a1b10604..cae0d20a16e 100644 --- a/Shared/mods/deathmatch/logic/luascripts/inspect.lua.h +++ b/Shared/mods/deathmatch/logic/luascripts/inspect.lua.h @@ -8,7 +8,7 @@ namespace EmbeddedLuaCode Provide extra utility scripting functions: string inspect ( arg ) --Provides a human description of any argument, i.e. string,bool,table,element,xml etc string iprint ( ... ) --Prints any number of arguments in human readable format - + Table output adapted from inspect.lua provided by Kikito with minor modifiactions (License below) --]] inspect ={ @@ -370,7 +370,7 @@ function Inspector:putUserdata(v) local pType if getPickupType(v) == 0 then pType = "health" elseif getPickupType(v) == 1 then pType = "armor" - elseif getPickupType(v) == 2 then pType = "weapon["..getWeaponNameFromID(getPickupWeapon(v)).."]" + elseif getPickupType(v) == 2 then pType = "weapon["..getWeaponNameFromID(getPickupWeapon(v)).."]" else pType = "custom["..getElementModel(v).."]" end o = "elem:"..etype.."["..pType.."]"..ptr elseif etype == "marker" then @@ -395,8 +395,8 @@ function Inspector:putUserdata(v) else o = human..ptr end - - self:puts(o) + + self:puts(o) end function iprint(...) diff --git a/Shared/sdk/RTree.h b/Shared/sdk/RTree.h index 392a0520ba5..8c17e7989df 100644 --- a/Shared/sdk/RTree.h +++ b/Shared/sdk/RTree.h @@ -929,7 +929,7 @@ bool RTREE_QUAL::InsertRect(Rect* a_rect, const DATATYPE& a_id, Node** a_root, i { ASSERT(a_rect->m_min[index] <= a_rect->m_max[index]); } -#endif //_DEBUG +#endif //_DEBUG Node* newRoot; Node* newNode; @@ -1164,7 +1164,7 @@ ELEMTYPEREAL RTREE_QUAL::CalcRectVolume(Rect* a_rect) return RectSphericalVolume(a_rect); // Slower but helps certain merge cases #else // RTREE_USE_SPHERICAL_VOLUME return RectVolume(a_rect); // Faster but can cause poor merges -#endif // RTREE_USE_SPHERICAL_VOLUME +#endif // RTREE_USE_SPHERICAL_VOLUME } // Load branch buffer with branches from full node plus the extra branch. diff --git a/Shared/sdk/SString.h b/Shared/sdk/SString.h index 77e02e07a6d..e1664c333a8 100644 --- a/Shared/sdk/SString.h +++ b/Shared/sdk/SString.h @@ -18,7 +18,7 @@ // #include -#ifdef WIN32 +#ifdef WIN32 #ifndef va_copy #define va_copy(dest, orig) (dest) = (orig) #endif diff --git a/Shared/sdk/SharedUtil.Defines.h b/Shared/sdk/SharedUtil.Defines.h index 69e0d96a1b8..d46921c1b53 100644 --- a/Shared/sdk/SharedUtil.Defines.h +++ b/Shared/sdk/SharedUtil.Defines.h @@ -115,7 +115,7 @@ // As NDEBUG is not defined across most MTA projects, assert() will always be enabled // Use dassert for debug build only assertations -#if defined(MTA_DEBUG) || defined(DEBUG) || defined(_DEBUG) +#if defined(MTA_DEBUG) || defined(DEBUG) || defined(_DEBUG) #define dassert assert #else #define dassert(_Expression) ((void)0) diff --git a/Shared/sdk/SharedUtil.Game.h b/Shared/sdk/SharedUtil.Game.h index 27f408b0360..bee72ce2ed4 100644 --- a/Shared/sdk/SharedUtil.Game.h +++ b/Shared/sdk/SharedUtil.Game.h @@ -124,7 +124,7 @@ namespace SharedUtil #define WD_SECTION_STARTUP_FREEZE "L3" // Opened in loader, closed when loading screen is shown, or a startup problem is handled elsewhere #define WD_SECTION_NOT_USED_MAIN_MENU "L4" // Opened in loader, closed when main menu is used #define WD_SECTION_POST_INSTALL "L5" // Opened in when installer runs, closed when main menu is used - #define WD_SECTION_IS_QUITTING "Q0" // Open during quit + #define WD_SECTION_IS_QUITTING "Q0" // Open during quit #define WD_COUNTER_CRASH_CHAIN_BEFORE_ONLINE_GAME "CR1" // Counts consecutive crashes before the online game starts #define WD_COUNTER_CRASH_CHAIN_BEFORE_LOADING_SCREEN "CR2" // Counts consecutive crashes before the loading screen is shown #define WD_COUNTER_CRASH_CHAIN_BEFORE_USED_MAIN_MENU "CR3" // Counts consecutive crashes before the main menu is used diff --git a/Shared/sdk/SharedUtil.Misc.h b/Shared/sdk/SharedUtil.Misc.h index 1bf1357a4c9..669158d2e7b 100644 --- a/Shared/sdk/SharedUtil.Misc.h +++ b/Shared/sdk/SharedUtil.Misc.h @@ -45,7 +45,7 @@ namespace SharedUtil // #ifdef _WINDOWS_ int MessageBoxUTF8(HWND hWnd, SString lpText, SString lpCaption, UINT uType); - #endif + #endif // // Get startup directory as saved in the registry by the launcher diff --git a/Shared/sdk/SharedUtil.Profiling.h b/Shared/sdk/SharedUtil.Profiling.h index 903ec489a59..e7809c979d3 100644 --- a/Shared/sdk/SharedUtil.Profiling.h +++ b/Shared/sdk/SharedUtil.Profiling.h @@ -85,8 +85,8 @@ namespace SharedUtil const char* szClockSectionTag = tag #define CLOCK1(name) CLOCK( szClockSectionTag, name ) - #define UNCLOCK1(name) UNCLOCK( szClockSectionTag, name) - #define CLOCK_CALL1(code) CLOCK_CALL( szClockSectionTag, code ) + #define UNCLOCK1(name) UNCLOCK( szClockSectionTag, name) + #define CLOCK_CALL1(code) CLOCK_CALL( szClockSectionTag, code ) // // Performance stat resulting diff --git a/utils/win-apply-clang-format.bat b/utils/win-apply-clang-format.bat index 70f9707404b..3aac58c4113 100644 --- a/utils/win-apply-clang-format.bat +++ b/utils/win-apply-clang-format.bat @@ -41,15 +41,18 @@ goto:eof :doformat echo Processing directory "%1" -echo Tabs to spaces -call:searchInReplaced %FINDANDREPLACE% --dir "%1" --useRegEx --find "\t" --replace " " - :: Use 0A end-of-line marker for the duration of formatting set EOL=\n echo Conform line endings call:searchInReplaced %FINDANDREPLACE% --dir "%1" --useRegEx --useEscapeChars --find "\r\n" --replace "%EOL%" call:searchInReplaced %FINDANDREPLACE% --dir "%1" --useRegEx --useEscapeChars --find "\r" --replace "%EOL%" +echo Tabs to spaces +call:searchInReplaced %FINDANDREPLACE% --dir "%1" --useRegEx --find "\t" --replace " " + +echo Remove trailing spaces +call:searchInReplaced %FINDANDREPLACE% --dir "%1" --useRegEx --useEscapeChars --find " +%EOL%" --replace "%EOL%" + echo Remove DEVELOPERS call:searchInReplaced %FINDANDREPLACE% --dir "%1" --useRegEx --find ".*DEVELOPERS.*(%EOL%.*\w.*)*%EOL%(.*)" --replace "$2" @@ -57,7 +60,7 @@ echo Remove inline from class methods call:searchInReplaced %FINDANDREPLACE% --dir "%1" --useRegEx --find "^(class(.*%EOL%)*)( +)inline +((.*%EOL%)*})" --replace "$1$3$4" echo Exclude _asm blocks -%FINDANDREPLACE% --dir "%1" --useRegEx --useEscapeChars --find "(^.*_asm(%EOL%)? *{(.*%EOL%)*?.*}.*)" --replace "// clang-format off%EOL%//TEMP%EOL%$1%EOL%//TEMP%EOL%// clang-format on" +%FINDANDREPLACE% --dir "%1" --useRegEx --useEscapeChars --find "(^.*_asm *(%EOL%)? *{(.*%EOL%)*?.*}.*)" --replace "// clang-format off%EOL%//TEMP%EOL%$1%EOL%//TEMP%EOL%// clang-format on" echo Exclude preprocessor directives %FINDANDREPLACE% --dir "%1" --useRegEx --useEscapeChars --find "^( *?#(.*?\\%EOL%)*(.*?%EOL%))" --replace "#dummy%EOL%// clang-format off%EOL%//TEMP%EOL%$1//TEMP%EOL%// clang-format on%EOL%#dummy%EOL%"