From ea71ddf847e639b69d524c949dbf1b44467f1de8 Mon Sep 17 00:00:00 2001 From: samisalreadytaken <46823719+samisalreadytaken@users.noreply.github.com> Date: Wed, 1 Jul 2026 19:53:08 +0300 Subject: [PATCH 1/2] Add vscript EmitSound_t::Get/SetPitch --- sp/src/game/shared/mapbase/vscript_funcs_shared.cpp | 3 +++ sp/src/game/shared/mapbase/vscript_funcs_shared.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sp/src/game/shared/mapbase/vscript_funcs_shared.cpp b/sp/src/game/shared/mapbase/vscript_funcs_shared.cpp index 7260029f137..25599e5ef38 100644 --- a/sp/src/game/shared/mapbase/vscript_funcs_shared.cpp +++ b/sp/src/game/shared/mapbase/vscript_funcs_shared.cpp @@ -589,6 +589,9 @@ BEGIN_SCRIPTDESC_ROOT_NAMED( ScriptEmitSound_t, "EmitSound_t", "" ) DEFINE_SCRIPTFUNC( GetFlags, "Gets the sound's flags. See the 'SND_' set of constants." ) DEFINE_SCRIPTFUNC( SetFlags, "Sets the sound's flags. See the 'SND_' set of constants." ) + DEFINE_SCRIPTFUNC( GetPitch, "" ) + DEFINE_SCRIPTFUNC( SetPitch, "Sets the sound's pitch in range [1, 255]" ) + DEFINE_SCRIPTFUNC( GetSpecialDSP, "" ) DEFINE_SCRIPTFUNC( SetSpecialDSP, "" ) diff --git a/sp/src/game/shared/mapbase/vscript_funcs_shared.h b/sp/src/game/shared/mapbase/vscript_funcs_shared.h index 16db5ffa92c..00c90380aa0 100644 --- a/sp/src/game/shared/mapbase/vscript_funcs_shared.h +++ b/sp/src/game/shared/mapbase/vscript_funcs_shared.h @@ -236,6 +236,9 @@ struct ScriptEmitSound_t : public EmitSound_t int GetFlags() { return m_nFlags; } void SetFlags( int nFlags ) { m_nFlags = nFlags; } + int GetPitch() { return m_nPitch; } + void SetPitch( int nPitch ) { m_nPitch = nPitch; } + int GetSpecialDSP() { return m_nSpecialDSP; } void SetSpecialDSP( int nSpecialDSP ) { m_nSpecialDSP = nSpecialDSP; } From 49b4d492cdb036a8d7f9282fd8381a7f69f13643 Mon Sep 17 00:00:00 2001 From: samisalreadytaken <46823719+samisalreadytaken@users.noreply.github.com> Date: Wed, 1 Jul 2026 19:53:25 +0300 Subject: [PATCH 2/2] Note invalid return type --- sp/src/game/shared/mapbase/vscript_funcs_shared.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sp/src/game/shared/mapbase/vscript_funcs_shared.h b/sp/src/game/shared/mapbase/vscript_funcs_shared.h index 00c90380aa0..4064f9bb25e 100644 --- a/sp/src/game/shared/mapbase/vscript_funcs_shared.h +++ b/sp/src/game/shared/mapbase/vscript_funcs_shared.h @@ -250,6 +250,9 @@ struct ScriptEmitSound_t : public EmitSound_t float GetSoundTime() { return m_flSoundTime; } void SetSoundTime( float flSoundTime ) { m_flSoundTime = flSoundTime; } + // NOTE: Incorrectly returns float for boolean type. + // Fixing this would break scripts explicitly comparing against 0 or 1 + // Keeping this would prevent implicit falseness check in a language such as Lua where 0.0 is truthy float GetEmitCloseCaption() { return m_bEmitCloseCaption; } void SetEmitCloseCaption( bool bEmitCloseCaption ) { m_bEmitCloseCaption = bEmitCloseCaption; }