-
-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call of Chernobyl 1.4.22: NPC sound play crash #1799
Labels
Bug
The issue in the run-time.
Call of Chernobyl
This can affect Call of Chernobyl compatibility, or related to it.
Comments
A quick and dirty way to avoid crashing (not solve it). I edited sound_theme.script at npc_sound:play() function to check if played_id is not a nill before doing anything with it. |
Xottab-DUTY
added a commit
that referenced
this issue
Mar 16, 2025
Don't read out of bounds. If id is bigger than the number of elements, just select random sound just like if -1 is being passed
Correct fix for the script file is this: --- sound_theme.script Thu Sep 21 03:52:17 2023
+++ sound_theme.script Thu Mar 20 05:38:25 2025
@@ -22,7 +22,7 @@
--' Параметры вычитывания звука
self.prefix = snd_ini:r_bool_ex(section,"npc_prefix",false)
self.path = snd_ini:r_string_ex(section,"path") or ""
- self.shuffle = snd_ini:r_string_ex(section,"shuffle") or "rand"
+ self.shuffle = snd_ini:r_string_ex(section,"shuffle") or "rnd"
self.group_snd = snd_ini:r_bool_ex(section,"group_snd",false)
self.play_always = snd_ini:r_bool_ex(section,"play_always",false)
self.is_combat_sound = snd_ini:r_bool_ex(section,"is_combat_sound",false)
@@ -287,6 +287,9 @@
end
return 0
end
+
+ printf("sound theme section[%s] has wrong shuffle[%s] parameter", self.section, self.shuffle)
+ return -1
end
function npc_sound:stop(obj_id)
local npc = db.storage[obj_id] and db.storage[obj_id].object Here is already fixed CoC 1.4.22 fixed file: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
The issue in the run-time.
Call of Chernobyl
This can affect Call of Chernobyl compatibility, or related to it.
Describe the bug
A crash happens to the bug reporting screen randomly. I suspect it is related to NPCs playing music instruments or speaking.
To Reproduce
Steps to reproduce the behavior:
BugTrap error report
NPC sound play crash.zip
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: