Skip to content

Commit a90f5a2

Browse files
authored
[ZH] Fix crash with USA Particle Cannon when the last scripted target waypoint is reached before the end of the firing sequence (#1206)
1 parent e691f17 commit a90f5a2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,17 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update()
593593
Int linkCount = way->getNumLinks();
594594
Int which = GameLogicRandomValue( 0, linkCount-1 );
595595
way = way->getLink( which );
596-
m_nextDestWaypointID = way->getID();
597-
m_overrideTargetDestination.set( way->getLocation() );
596+
597+
// TheSuperHackers @bugfix Caball009 27/06/2025 Check if the last way point has been reached before attempting to access the next way point.
598+
if ( way )
599+
{
600+
m_nextDestWaypointID = way->getID();
601+
m_overrideTargetDestination.set(way->getLocation());
602+
}
603+
else
604+
{
605+
m_nextDestWaypointID = INVALID_WAYPOINT_ID;
606+
}
598607
}
599608
}
600609
}

0 commit comments

Comments
 (0)