From cf30982ddfa935a68079400216501f71be1a112b Mon Sep 17 00:00:00 2001 From: Nikolay Ambartsumov Date: Thu, 26 Nov 2020 12:48:03 +0200 Subject: [PATCH] Add Polyobj_StopSound special --- src/playsim/actionspecials.h | 1 + src/playsim/p_lnspec.cpp | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/playsim/actionspecials.h b/src/playsim/actionspecials.h index fcd4d386b..78f2e87eb 100644 --- a/src/playsim/actionspecials.h +++ b/src/playsim/actionspecials.h @@ -271,6 +271,7 @@ DEFINE_SPECIAL(Floor_MoveToValueAndCrush, 279, 4, 5, 5) DEFINE_SPECIAL(Ceiling_MoveToValueAndCrush, 280, 4, 5, 5) DEFINE_SPECIAL(Line_SetAutomapFlags, 281, 3, 3, 3) DEFINE_SPECIAL(Line_SetAutomapStyle, 282, 2, 2, 2) +DEFINE_SPECIAL(Polyobj_StopSound, 283, 1, 1, 1) DEFINE_SPECIAL(Line_QuickPortal, 301, -1, -1, 1) diff --git a/src/playsim/p_lnspec.cpp b/src/playsim/p_lnspec.cpp index 690636c38..2dd6d9493 100644 --- a/src/playsim/p_lnspec.cpp +++ b/src/playsim/p_lnspec.cpp @@ -57,6 +57,7 @@ #include "g_levellocals.h" #include "vm.h" #include "p_destructible.h" +#include "s_sndseq.h" // Remaps EE sector change types to Generic_Floor values. According to the Eternity Wiki: /* @@ -234,6 +235,20 @@ FUNC(LS_Polyobj_Stop) return EV_StopPoly (Level, arg0); } +FUNC(LS_Polyobj_StopSound) +// Polyobj_StopSound (po) +{ + FPolyObj *poly; + + poly = Level->GetPolyobj(arg0); + if (poly != nullptr) + { + SN_StopSequence(poly); + } + + return true; +} + FUNC(LS_Door_Close) // Door_Close (tag, speed, lighttag) { @@ -3813,8 +3828,7 @@ static lnSpecFunc LineSpecials[] = /* 280 */ LS_Ceiling_MoveToValueAndCrush, /* 281 */ LS_Line_SetAutomapFlags, /* 282 */ LS_Line_SetAutomapStyle, - - + /* 283 */ LS_Polyobj_StopSound, }; #define DEFINE_SPECIAL(name, num, min, max, mmax) {#name, num, min, max, mmax}, @@ -3965,4 +3979,3 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, ExecuteSpecial) ACTION_RETURN_INT(P_ExecuteSpecial(self, special, linedef, activator, lineside, arg1, arg2, arg3, arg4, arg5)); } -