diff --git a/Client/game_sa/CVehicleSA.h b/Client/game_sa/CVehicleSA.h index 8186d261c87..cb6f5b1ec78 100644 --- a/Client/game_sa/CVehicleSA.h +++ b/Client/game_sa/CVehicleSA.h @@ -284,7 +284,7 @@ class CVehicleSAInterface : public CPhysicalSAInterface ((void(__thiscall*)(CVehicleSAInterface*, RwFrame*, std::uint32_t))0x6D2700)(this, component, state); } - bool IsPassenger(CPedSAInterface* ped) const noexcept { + bool IsPassenger(CPedSAInterface* ped) const { return ((bool(__thiscall*)(CVehicleSAInterface const*, CPedSAInterface*))0x6D1BD0)(this, ped); } @@ -483,7 +483,7 @@ class CVehicleSA : public virtual CVehicle, public virtual CPhysicalSA void SetRailTrack(BYTE ucTrackID); float GetTrainPosition(); void SetTrainPosition(float fPosition, bool bRecalcOnRailDistance = true); - bool IsPassenger(CPed* pPed) noexcept { return GetVehicleInterface()->IsPassenger(pPed->GetPedInterface()); }; + bool IsPassenger(CPed* pPed) { return GetVehicleInterface()->IsPassenger(pPed->GetPedInterface()); }; void AddVehicleUpgrade(DWORD dwModelID); void RemoveVehicleUpgrade(DWORD dwModelID); diff --git a/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp b/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp index 8a222cda1d7..b75c835f7c0 100644 --- a/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp +++ b/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp @@ -967,7 +967,7 @@ ADD_ENUM(eVehicleAudioSettingProperty::ENGINE_ON_SOUND_BANK_ID, "engine-on-sound ADD_ENUM(eVehicleAudioSettingProperty::HORN_HIGH, "horn-high") ADD_ENUM(eVehicleAudioSettingProperty::HORN_TON, "horn-ton") ADD_ENUM(eVehicleAudioSettingProperty::HORN_VOLUME_DELTA, "horn-volume-delta") -ADD_ENUM(eVehicleAudioSettingProperty::RADIO_NUM, "radion-num") +ADD_ENUM(eVehicleAudioSettingProperty::RADIO_NUM, "radio-num") ADD_ENUM(eVehicleAudioSettingProperty::RADIO_TYPE, "radio-type") ADD_ENUM(eVehicleAudioSettingProperty::SOUND_TYPE, "sound-type") ADD_ENUM(eVehicleAudioSettingProperty::BASS_SETTING, "bass-setting") diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp index 4020a1d5eb5..b6c3b12fad0 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp @@ -4439,11 +4439,23 @@ bool CLuaVehicleDefs::SetVehicleModelAudioSetting(const uint32_t uiModel, const pModelSettings.SetDoorSound(varValue); break; case eVehicleAudioSettingProperty::ENGINE_OFF_SOUND_BANK_ID: + { + // Using SPC_ sound banks other than SPC_EA causes a crash + if (varValue > 410) + throw std::invalid_argument("Invalid engine-off-sound-bank-id value"); + pModelSettings.SetEngineOffSoundBankID(varValue); break; + } case eVehicleAudioSettingProperty::ENGINE_ON_SOUND_BANK_ID: + { + // Using SPC_ sound banks other than SPC_EA causes a crash + if (varValue > 410) + throw std::invalid_argument("Invalid engine-on-sound-bank-id value"); + pModelSettings.SetEngineOnSoundBankID(varValue); break; + } case eVehicleAudioSettingProperty::HORN_HIGH: pModelSettings.SetHornHign(varValue); break; @@ -4502,11 +4514,23 @@ bool CLuaVehicleDefs::SetVehicleAudioSetting(CClientVehicle* pVehicle, const eVe pModelSettings.SetDoorSound(varValue); break; case eVehicleAudioSettingProperty::ENGINE_OFF_SOUND_BANK_ID: + { + // Using SPC_ sound banks other than SPC_EA causes a crash + if (varValue > 410) + throw std::invalid_argument("Invalid engine-off-sound-bank-id value"); + pModelSettings.SetEngineOffSoundBankID(varValue); break; + } case eVehicleAudioSettingProperty::ENGINE_ON_SOUND_BANK_ID: + { + // Using SPC_ sound banks other than SPC_EA causes a crash + if (varValue > 410) + throw std::invalid_argument("Invalid engine-on-sound-bank-id value"); + pModelSettings.SetEngineOnSoundBankID(varValue); break; + } case eVehicleAudioSettingProperty::HORN_HIGH: pModelSettings.SetHornHign(varValue); break;