Fixed some sound related stuff

This commit is contained in:
Pao
2023-03-01 22:29:20 +01:00
parent d2f5c05d10
commit 7693963d77
2 changed files with 7 additions and 19 deletions

View File

@@ -24,30 +24,18 @@ function JCIO_CutLimbAction:update()
self.surgeon:faceThisObject(self.patient)
end
local worldSoundRadius = 3
local soundDelay = 6
-- Sound handling
if self.soundTime + soundDelay < getTimestamp() then
if self.soundTime < getTimestamp() then
self.soundTime = getTimestamp()
if not self.chatacter:getEmitter():isPlaying(self.sawSound) then
if not self.character:getEmitter():isPlaying(self.sawSound) then
print("JCIO: Running sound again")
self.sawSound = self.character:getEmitter():playSound("Amputation_Sound")
addSound(self.surgeon, self.surgeon:getX(), self.surgeon:getY(), self.surgeon:getZ(), 3, 3)
end
end
-- TODO This is to handle MP I guess?
if worldSoundRadius > 0 then
self.worldSoundTime = getTimestamp()
addSound(self.surgeon, self.surgeon:getX(), self.surgeon:getY(), self.surgeon:getZ(), worldSoundRadius, worldSoundRadius)
end
end
function JCIO_CutLimbAction:stop()