File tree 1 file changed +8
-3
lines changed
addons/source-python/packages/source-python/engines 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 34
34
# Paths
35
35
from paths import GAME_PATH
36
36
# Stringtables
37
- from stringtables import string_tables
37
+ from stringtables import INVALID_STRING_INDEX , string_tables
38
38
from stringtables .downloads import Downloadables
39
39
40
40
@@ -323,7 +323,9 @@ def is_precached(self):
323
323
324
324
:rtype: bool
325
325
"""
326
- return self .sample in string_tables .soundprecache
326
+ # We can't use engine_sound.is_sound_precached here because it always
327
+ # returns True.
328
+ return string_tables .soundprecache [self .sample ] != INVALID_STRING_INDEX
327
329
328
330
329
331
class StreamSound (_BaseSound ):
@@ -368,4 +370,7 @@ def is_precached(self):
368
370
369
371
:rtype: bool
370
372
"""
371
- return self ._stream_sample in string_tables .soundprecache
373
+ # We can't use engine_sound.is_sound_precached here because it always
374
+ # returns True.
375
+ index = string_tables .soundprecache [self ._stream_sample ]
376
+ return index != INVALID_STRING_INDEX
You can’t perform that action at this time.
0 commit comments