[saco] Match VehicleHorn_Hook()

This commit is contained in:
RD42 2024-10-14 17:10:18 +08:00
parent 249b3e13ec
commit c09dde988d

View File

@ -258,15 +258,16 @@ NUDE VehicleHorn_Hook()
_asm mov eax, [edx+16]
_asm mov _pHornVehicle, eax
if( _pHornVehicle && _pHornVehicle->pDriver &&
IN_VEHICLE(_pHornVehicle->pDriver) &&
_pHornVehicle->pDriver->dwPedType == 4 )
_byteSavedControlFlags = _pHornVehicle->entity.nControlFlags;
if( _pHornVehicle->pDriver &&
IN_VEHICLE(_pHornVehicle->pDriver) )
{
_byteSavedControlFlags = _pHornVehicle->entity.nControlFlags;
_pHornVehicle->entity.nControlFlags = 0x02;
_iHasSetHornHookFix = 1;
//_iHasSetHornHookFix = 1;
} else {
_iHasSetHornHookFix = 0;
_pHornVehicle->entity.nControlFlags = 0x22;
//_iHasSetHornHookFix = 0;
}
_asm push _dwVehicleParams
@ -274,9 +275,7 @@ NUDE VehicleHorn_Hook()
_asm mov edx, 0x5002C0
_asm call edx
if(_iHasSetHornHookFix) {
_pHornVehicle->entity.nControlFlags = _byteSavedControlFlags;
}
_pHornVehicle->entity.nControlFlags = _byteSavedControlFlags;
_asm retn 4
}