Skip to content
Merged
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
11 changes: 8 additions & 3 deletions addons/source-python/packages/source-python/engines/sound.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# Paths
from paths import GAME_PATH
# Stringtables
from stringtables import string_tables
from stringtables import INVALID_STRING_INDEX, string_tables
from stringtables.downloads import Downloadables


Expand Down Expand Up @@ -323,7 +323,9 @@ def is_precached(self):

:rtype: bool
"""
return self.sample in string_tables.soundprecache
# We can't use engine_sound.is_sound_precached here because it always
# returns True.
return string_tables.soundprecache[self.sample] != INVALID_STRING_INDEX


class StreamSound(_BaseSound):
Expand Down Expand Up @@ -368,4 +370,7 @@ def is_precached(self):

:rtype: bool
"""
return self._stream_sample in string_tables.soundprecache
# We can't use engine_sound.is_sound_precached here because it always
# returns True.
index = string_tables.soundprecache[self._stream_sample]
return index != INVALID_STRING_INDEX