Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit bfe8a22

Browse files
GacyrGacyr
authored andcommitted
Hopefully fixed destroyer cannon sound lua problems
1 parent 0bed993 commit bfe8a22

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Dummy.rte/Devices/Weapons/Destroyer/Destroyer.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ AddAmmo = AEmitter
153153
PushesEmitter = 0
154154
InheritsVel = 0
155155
EmissionSound = SoundContainer
156+
PresetName = Destroyer Emission Sound
156157
AttenuationStartDistance = 140
157158
AddSound = ContentFile
158159
FilePath = Dummy.rte/Devices/Weapons/Destroyer/Sounds/ProjectileLoop1.flac

Dummy.rte/Devices/Weapons/Destroyer/DestroyerCannon.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ function Create(self)
1212
--The following timer prevents a glitch where you can fire twice by putting the gun inside the inventory while charging
1313
self.inventorySwapTimer = Timer();
1414
self.inventorySwapTimer:SetSimTimeLimitMS(math.ceil(TimerMan.DeltaTimeMS));
15+
self.activeSound = CreateSoundContainer("Destroyer Emission Sound", "Dummy.rte");
1516
end
1617
function Update(self)
1718
if self.Magazine then
@@ -48,11 +49,11 @@ function Update(self)
4849
if self:IsActivated() then
4950
self:Deactivate();
5051

51-
if self.activeSound then
52+
if self.activeSound:IsBeingPlayed() then
5253
AudioMan:SetSoundPosition(self.activeSound, self.Pos);
5354
AudioMan:SetSoundPitch(self.activeSound, self.charge);
5455
else
55-
self.activeSound = AudioMan:PlaySound("Dummy.rte/Devices/Weapons/Destroyer/Sounds/ProjectileLoop1.flac", self.Pos, -1, -1, 100, 0, 100, false);
56+
self.activeSound:Play(self.Pos);
5657
end
5758
if not self.chargeTimer:IsPastSimTimeLimit() then
5859
self.charge = self.chargeTimer.ElapsedSimTimeMS/self.chargeDelay;

0 commit comments

Comments
 (0)