Skip to content

Commit d3206d8

Browse files
committed
Multithreaded repeater shot
1 parent 34552e8 commit d3206d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Data/Dummy.rte/Devices/Weapons/Repeater/RepeaterShot.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ function Create(self)
2020
self.endPar = CreateMOSParticle("Tiny Smoke Ball 1 Glow Yellow");
2121
end
2222

23-
function Update(self)
23+
function ThreadedUpdate(self)
2424
if not self.ToDelete then
25+
-- Touching other things in non-synced update is bad, but because we know that nothing else is gonna be running scripts on it, we can get away with this
2526
for i = 1, self.trailParCount do
2627
if self.trailPar[i] and MovableMan:IsParticle(self.trailPar[i]) then
2728
self.trailPar[i].Pos = self.Pos + Vector(RangeRand(-0.5, 0.5), RangeRand(-0.5, 0.5)) - Vector(self.PrevVel.X, self.PrevVel.Y):SetMagnitude(math.min(self.PrevVel.Magnitude, self.trailLength + 1) * i/self.trailParCount);

0 commit comments

Comments
 (0)