diff --git a/src/scripting/vmthunks_actors.cpp b/src/scripting/vmthunks_actors.cpp index 6338507b6..9a44ac916 100644 --- a/src/scripting/vmthunks_actors.cpp +++ b/src/scripting/vmthunks_actors.cpp @@ -198,7 +198,14 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_StartSound, A_StartSound) return 0; } -DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_StartSoundIfNotSame, A_StartSound) + +void A_StartSoundIfNotSame(AActor *self, int soundid, int checksoundid, int channel, int flags, double volume, double attenuation, double pitch, double startTime) +{ + if (!S_AreSoundsEquivalent (self, soundid, checksoundid)) + A_StartSound(self, soundid, channel, flags, volume, attenuation, pitch, startTime); +} + +DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_StartSoundIfNotSame, A_StartSoundIfNotSame) { PARAM_SELF_PROLOGUE(AActor); PARAM_SOUND(soundid); @@ -209,8 +216,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_StartSoundIfNotSame, A_StartSound) PARAM_FLOAT(attenuation); PARAM_FLOAT(pitch); PARAM_FLOAT(startTime); - if (!S_AreSoundsEquivalent (self, soundid, checksoundid)) - A_StartSound(self, soundid, channel, flags, volume, attenuation, pitch, startTime); + A_StartSoundIfNotSame(self, soundid, checksoundid, channel, flags, volume, attenuation, pitch, startTime); return 0; }