Skip to content

Commit

Permalink
fix a few crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitawastaken committed Jul 30, 2024
1 parent 4be3763 commit d1e432a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lua/copsound.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Hooks:PreHook(CopSound, "init", "sh_init", function(self)
self._speak_done_callback = function()
self._speak_expire_t = 0
end
end)

Hooks:PostHook(CopSound, "init", "sh_init", function(self)
--Mostly just here in the event we have a unit to have both an 'entrance' line *and* a global spawn in noise
if self._unit:base():char_tweak().spawn_sound_event_2 then
self._unit:sound():play(self._unit:base():char_tweak().spawn_sound_event_2, nil, nil)
Expand Down
3 changes: 2 additions & 1 deletion lua/gamesetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ Hooks:PostHook(GameSetup, "load_packages", "sh_load_packages", function(self)
end

--For Elite/ZEAL shield's Terminator styled BANG BANG BANG spawn sound
--[[ seems to crash on load for now
if difficulty_index == 6 and not PackageManager:loaded("soundbanks/sfx_hos") then
PackageManager:load("soundbanks/sfx_hos")
elseif difficulty_index ~= 6 and level ~= "nmh" and PackageManager:loaded("soundbanks/sfx_hos") then
PackageManager:unload("soundbanks/sfx_hos")
end
end]]
end)

0 comments on commit d1e432a

Please sign in to comment.