diff --git a/Client/game_sa/CVehicleAudioSettingsEntrySA.h b/Client/game_sa/CVehicleAudioSettingsEntrySA.h index 8f24124140..95702cfe0d 100644 --- a/Client/game_sa/CVehicleAudioSettingsEntrySA.h +++ b/Client/game_sa/CVehicleAudioSettingsEntrySA.h @@ -40,10 +40,10 @@ class CVehicleAudioSettingsEntrySA final : public CVehicleAudioSettingsEntry CVehicleAudioSettingsEntrySA(tVehicleAudioSettings* pSettings) { m_Settings = *pSettings; }; ~CVehicleAudioSettingsEntrySA() = default; - tVehicleAudioSettings* getInterface() { return &m_Settings; }; + const tVehicleAudioSettings& getInterface() const noexcept { return m_Settings; }; void Assign(const tVehicleAudioSettings& settings) noexcept { m_Settings = settings; } - void Assign(const CVehicleAudioSettingsEntry* settings) noexcept { m_Settings = static_cast(settings)->m_Settings; }; + void Assign(const CVehicleAudioSettingsEntry* settings) noexcept { m_Settings = static_cast(settings)->getInterface(); }; eVehicleSoundType GetSoundType() const noexcept override { return m_Settings.m_eVehicleSoundType; }; short GetEngineOnSoundBankID() const noexcept override { return m_Settings.m_nEngineOnSoundBankId; }; diff --git a/Client/game_sa/CVehicleSA.cpp b/Client/game_sa/CVehicleSA.cpp index 1fda27088b..2b45872e29 100644 --- a/Client/game_sa/CVehicleSA.cpp +++ b/Client/game_sa/CVehicleSA.cpp @@ -912,18 +912,8 @@ void CVehicleSA::SetEngineOn(bool bEngineOn) bool CVehicleSA::IsPassenger(CPed* pPed) { - DWORD dwThis = (DWORD)m_pInterface; - DWORD dwFunc = FUNC_CVehicle_IsPassenger; - bool bReturn = false; - - _asm - { - mov ecx, dwThis - push pPed - call dwFunc - mov bReturn, al - } - return bReturn; + using FUNC_CVehicle_IsPassenger_t = bool(__thiscall*)(CVehicleSAInterface* self, CPedSAInterface* ped); + return ((FUNC_CVehicle_IsPassenger_t)(FUNC_CVehicle_IsPassenger))(GetVehicleInterface(), pPed->GetPedInterface()); } CPed* CVehicleSA::GetDriver()