Skip to content
Open
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
3 changes: 3 additions & 0 deletions sp/src/game/shared/mapbase/vscript_funcs_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, "" )

Expand Down
6 changes: 6 additions & 0 deletions sp/src/game/shared/mapbase/vscript_funcs_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand All @@ -247,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; }

Expand Down
Loading