Skip to content

Commit b87e2ad

Browse files
authored
Merge pull request #76 from cortex-command-community/nucleoshot-loading-fix
Fix nucleo shots breaking if loading mid-explosion-sequence
2 parents c7cfdc1 + 1aeb1e7 commit b87e2ad

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2222

2323
- Reverted a change to pathfinding, that although was technically accurate, caused issues with the AI being too eager to path up-and-over obstacles instead of through them. In the future this will likely be revisited when we get jump-aware pathfinding.
2424

25+
- Fixed nucleo shots breaking if saving and loading them mid explosion sequence.
26+
2527
- Fixed Dummy Assault resetting funds to their initial value upon loading a saved game.
2628

2729
</details>

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

Lines changed: 8 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
@@ -54,6 +54,7 @@ end
5454

5555
function Create(self)
5656
self.detTimer = Timer();
57+
self.detDelay = 1000;
5758
self.boom = false;
5859

5960
self.speed = 15;
@@ -117,10 +118,12 @@ function ThreadedUpdate(self)
117118
end
118119

119120
function SyncedUpdate(self)
120-
for k, particle in pairs(self.connectableParticles) do
121-
if MovableMan:ValidMO(particle) then
122-
particle.Pos = self.Pos + Vector(math.random() * 5, 0):RadRotate(math.random() * math.pi * 2);
123-
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
124127
end
125128
end
126129

0 commit comments

Comments
 (0)