From ea99b6de124ac9f908788a828d06b1746c8bc81a Mon Sep 17 00:00:00 2001 From: Storm dragon Date: Wed, 30 Dec 2015 17:19:03 -0500 Subject: [PATCH] Weapons other than the first 2 guns are no longer preloaded. --- bottleblaster/bottleblaster.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bottleblaster/bottleblaster.lua b/bottleblaster/bottleblaster.lua index 7bf9379..969c594 100644 --- a/bottleblaster/bottleblaster.lua +++ b/bottleblaster/bottleblaster.lua @@ -69,8 +69,11 @@ local function play_sound(sound, channel, loop) sound:playChannel(channel, loop) end --- I would rather get rid of this function and just have the one play function -local function pan_sound(mixer, sound) +local function play_at_location(sound, xPosition, yPosition) + channel = channel or -1 + loop = loop or 0 + xPosition = xPosition or 0 + yPosition = yPosition or 0 mixer.SetPanning(-1, 255, 127) sound:playChannel(-1, 0) end @@ -145,7 +148,9 @@ while running do keyName = "0" elseif tonumber(keyName) >= 1 and tonumber(keyName) <= 5 then weapon = tonumber(keyName) - loaded = true + if weapon >= 3 then + loaded = false + end if weapon == 1 then speak("pistal") elseif weapon == 2 then