Skip to content

Commit 4a546cf

Browse files
committed
more ways they can break during loading, fixed
1 parent 752c34e commit 4a546cf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Data/Techion.rte/Devices/Weapons/Nucleo/NucleoShot.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function Explode(self)
1919
melter.Pos = self.Pos;
2020
melter.Team = self.Team;
2121
melter.Sharpness = ToActor(parent).ID;
22-
melter.PinStrength = self.disintegrationStrength * math.sqrt(math.max(1, #self.connectableParticles));
22+
melter.PinStrength = self.disintegrationStrength * math.sqrt(math.max(1, (self.connectableParticles and #self.connectableParticles or 1)));
2323
MovableMan:AddMO(melter);
2424
end
2525
end
@@ -118,10 +118,12 @@ function ThreadedUpdate(self)
118118
end
119119

120120
function SyncedUpdate(self)
121-
for k, particle in pairs(self.connectableParticles) do
122-
if MovableMan:ValidMO(particle) then
123-
particle.Pos = self.Pos + Vector(math.random() * 5, 0):RadRotate(math.random() * math.pi * 2);
124-
particle:SendMessage("Nucleo_Explode");
121+
if self.connectableParticles then
122+
for k, particle in pairs(self.connectableParticles) do
123+
if MovableMan:ValidMO(particle) then
124+
particle.Pos = self.Pos + Vector(math.random() * 5, 0):RadRotate(math.random() * math.pi * 2);
125+
particle:SendMessage("Nucleo_Explode");
126+
end
125127
end
126128
end
127129

0 commit comments

Comments
 (0)