Skip to content

Commit

Permalink
Last VS2015 compile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jushar committed Aug 2, 2016
1 parent 26f5cdd commit dfb69b4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
15 changes: 15 additions & 0 deletions Client/mods/deathmatch/vs2015_fixes.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "StdInc.h"

#if _MSC_VER == 1900
/**
* VS2015 defines std io in another way which is incompatible to the way VS2013 used
* We can fix this however by defining the old way manually
* It's only required for libspeex, so once we replace libspeex, we can remove this fix
*/
FILE _iob[] = { *stdin, *stdout, *stderr };

extern "C" FILE * __cdecl __iob_func(void)
{
return _iob;
}
#endif
15 changes: 9 additions & 6 deletions Client/multiplayer_sa/CMultiplayerSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6638,6 +6638,7 @@ void CTaskSimpleGangDriveBy__ProcessPed()
*pRequiredAnim = m_pDrivebyAnimationHandler(*pRequiredAnim, requiredAnimGroup);
}

DWORD RETURN_CTaskSimpleGangDriveBy_ProcessPed_Cancel = 0x62D5C1;
void _declspec(naked) HOOK_CTaskSimpleGangDriveBy__ProcessPed()
{
// esi contains 'this'
Expand All @@ -6649,14 +6650,16 @@ void _declspec(naked) HOOK_CTaskSimpleGangDriveBy__ProcessPed()
CTaskSimpleGangDriveBy__ProcessPed();
_asm
{
popad;
popad
// Replaced code
cmp[esi + 28h], edi; // .text:0062D5A7
jnz 0x62D5C1; // .text:0062D5AA
cmp[esi + 28h], edi // .text:0062D5A7
jnz GangDriveBy_ProcessPed_Cancel // .text:0062D5AA
// Return to original code
jmp RETURN_CTaskSimplyGangDriveBy__ProcessPed;
jmp RETURN_CTaskSimplyGangDriveBy__ProcessPed

GangDriveBy_ProcessPed_Cancel:
jmp RETURN_CTaskSimpleGangDriveBy_ProcessPed_Cancel
}

}


Expand Down Expand Up @@ -6867,4 +6870,4 @@ void _declspec(naked) HOOK_CAERadioTrackManager__ChooseMusicTrackIndex ( )
// jump back to normal processing
jmp RETURN_CAERadioTrackManager__ChooseMusicTrackIndex
}
}
}
12 changes: 9 additions & 3 deletions Client/multiplayer_sa/CMultiplayerSA_1.3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1437,8 +1437,11 @@ void _declspec( naked ) HOOK_CWorld_RemoveFallenCars ( )
popad
mov eax, [esi + 14h]
test eax, eax
jz 565F57h
jz RemoveFallenCars_Cancel
jmp RETURN_CWorld_RemoveFallenCars_Cont

RemoveFallenCars_Cancel:
jmp HOOK_CWorld_RemoveFallenCars_Cont1
}
}

Expand Down Expand Up @@ -1608,8 +1611,11 @@ void _declspec( naked ) HOOK_CMultiplayerSA_ToggleTyreSmoke ( )
{
popad
test eax, 20000h
jnz 06DF3B9h
jnz ToggleTyreSmoke_Cancel
jmp dwReturnAddressTyreSmoke

ToggleTyreSmoke_Cancel:
jmp dwReturnIgnorePed
}
}

Expand Down Expand Up @@ -1697,4 +1703,4 @@ void _declspec(naked) HOOK_CProjectile_FixExplosionLocation ( )
lea eax, [esi+4]
jmp RETURN_CProjectile_FixExplosionLocation
}
}
}

0 comments on commit dfb69b4

Please sign in to comment.