Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Client/game_sa/CVehicleSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
24 changes: 24 additions & 0 deletions Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Loading