Skip to content

Commit

Permalink
ChaosMod/EffectSound3D: Only allow looping sounds with FollowEntity P…
Browse files Browse the repository at this point in the history
…layType
  • Loading branch information
pongo1231 committed Jan 18, 2025
1 parent 3e446c5 commit 1e5c6ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ChaosMod/Components/EffectSound/EffectSound3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ void EffectSound3D::OnRun()
ma_sound_set_rolloff(&sound.Handle, .1f);
ma_sound_set_pitch(&sound.Handle,
1.f + (!Hooks::GetTargetAudioPitch() ? 0.f : Hooks::GetTargetAudioPitch() * .0001f));
ma_sound_set_looping(&sound.Handle, sound.PlayOptions.PlayFlags & EffectSoundPlayFlags_Looping);

switch (sound.PlayOptions.PlayType)
{
Expand All @@ -119,6 +118,8 @@ void EffectSound3D::OnRun()
auto entityIsInAnyVeh = IS_PED_IN_ANY_VEHICLE(sound.PlayOptions.Entity, false);
auto adjEntityVel = GET_ENTITY_VELOCITY(entityIsInAnyVeh ? entityVeh : sound.PlayOptions.Entity);
ma_engine_listener_set_velocity(&m_maEngine, 0, adjEntityVel.x, adjEntityVel.y, adjEntityVel.z);

ma_sound_set_looping(&sound.Handle, sound.PlayOptions.PlayFlags & EffectSoundPlayFlags_Looping);
}
break;
case EffectSoundPlayType::AtCoords:
Expand Down

0 comments on commit 1e5c6ea

Please sign in to comment.