scpcb
scpcb copied to clipboard
Stream channels fix #2
- Removed unnecessary
ChannelPlaying
checks fromRemoveNPC
,KillSounds
,ResumeSounds
andPauseSounds
function. We don't need to check if the sound is playing, enough to know does it exist or not; - Added
CoughCHN
,VomitCHN
andRadioCHN
toPauseSounds
,ResumeSounds
andKillSounds
function; - Added channel existing check for
UpdateSoundOrigin(2)
andUpdateStreamSoundOrigin
function, so we don't need to check manually if the sound is existing. First, we don't need to try apply channel functions to null channel and produce unnecessary calculations. Second, added sound playing check because we need to use these functions only when the sound is playing. - Completely remove sound from memory. As you know,
FreeSound
,StopChannel
and etc. don't finally frees the memory, so I addedCHN = 0
lines. - Fixed spammable
Failed to find stream Sound: Unknown Stream
console error appearing in:
- SCP-079's chamber after finishing
Speech.ogg
sound; - Gate B area after playing
AlphaWarheadsFail.ogg
sound; - I'm not sure, but sometimes I saw this error for SCP-096. I noticed
n\SoundChn2_IsStream = 2
line that should haveTrue
value instead of2
. Maybe it shouldn't, who knows ¯_(ツ)_/¯ ; Always reset_isStream
parameter while removing a channel for preventing any confuses inUpdateStreamSounds
function. Also added more sound exist checks for preventingUnknow stream
error;
- Added
ChannelVolume (Chn, 0)
line toUpdateSoundOrigin(2)
function to prevent sound from being assigned a negative volume when sound emitter out of range. - Separated some conditions. First, we should check if the sounds exist. After, check if the sound is stream sound. Don't waste your time time to check them both.
Note:
-
RadioCHN
channel placed only inKillSounds
because placing inResumeSounds
andPauseSounds
doesn't affect on the channel. To do!