@@ -274,10 +274,10 @@ Bool ParticleUplinkCannonUpdate::initiateIntentToDoSpecialPower(const SpecialPow
274
274
return FALSE ;
275
275
}
276
276
277
- // getObject()->getControllingPlayer()->getAcademyStats()->recordSpecialPowerUsed( specialPowerTemplate );
278
-
279
277
if ( !BitIsSet ( commandOptions, COMMAND_FIRED_BY_SCRIPT ) )
280
278
{
279
+ DEBUG_ASSERTCRASH (targetPos, (" Particle Cannon target data must not be NULL" ));
280
+
281
281
// All human players have manual control and must "drive" the beam around!
282
282
m_startAttackFrame = TheGameLogic->getFrame ();
283
283
m_laserStatus = LASERSTATUS_NONE;
@@ -293,28 +293,21 @@ Bool ParticleUplinkCannonUpdate::initiateIntentToDoSpecialPower(const SpecialPow
293
293
{
294
294
// Script fired with a specific waypoint path, so set things up to follow the waypoint!
295
295
UnsignedInt now = TheGameLogic->getFrame ();
296
-
296
+
297
297
Coord3D pos;
298
- if ( way )
299
- {
300
- pos.set ( way->getLocation () );
301
- }
302
- else if ( targetObj )
303
- {
304
- pos.set ( targetObj->getPosition () );
305
- }
306
- m_startAttackFrame = max ( now, (UnsignedInt)1 );
298
+ pos.set ( way->getLocation () );
299
+
300
+ m_startAttackFrame = max ( now, (UnsignedInt)1 );
307
301
#if !RETAIL_COMPATIBLE_CRC
308
302
m_manualTargetMode = FALSE ;
309
303
#endif
310
304
m_scriptedWaypointMode = TRUE ;
311
- m_laserStatus = LASERSTATUS_NONE;
305
+ m_laserStatus = LASERSTATUS_NONE;
312
306
setLogicalStatus ( STATUS_READY_TO_FIRE );
313
307
m_specialPowerModule->setReadyFrame ( now );
314
- m_initialTargetPosition.set ( &pos );
308
+ m_initialTargetPosition.set ( &pos );
315
309
m_currentTargetPosition.set ( &pos );
316
310
317
- m_nextDestWaypointID = way->getID ();
318
311
Int linkCount = way->getNumLinks ();
319
312
Int which = GameLogicRandomValue ( 0 , linkCount-1 );
320
313
Waypoint *next = way->getLink ( which );
@@ -323,10 +316,15 @@ Bool ParticleUplinkCannonUpdate::initiateIntentToDoSpecialPower(const SpecialPow
323
316
m_nextDestWaypointID = next->getID ();
324
317
m_overrideTargetDestination.set ( next->getLocation () );
325
318
}
326
-
319
+ else
320
+ {
321
+ m_nextDestWaypointID = way->getID ();
322
+ }
327
323
}
328
324
else
329
325
{
326
+ DEBUG_ASSERTCRASH (targetPos || targetObj, (" Particle Cannon target data must not be NULL" ));
327
+
330
328
// All computer controlled players have automatic control -- the "S" curve.
331
329
UnsignedInt now = TheGameLogic->getFrame ();
332
330
@@ -343,12 +341,13 @@ Bool ParticleUplinkCannonUpdate::initiateIntentToDoSpecialPower(const SpecialPow
343
341
m_manualTargetMode = FALSE ;
344
342
m_scriptedWaypointMode = FALSE ;
345
343
#endif
346
- m_initialTargetPosition.set ( &pos );
347
- m_startAttackFrame = max ( now, (UnsignedInt)1 );
348
- m_laserStatus = LASERSTATUS_NONE;
344
+ m_initialTargetPosition.set ( &pos );
345
+ m_startAttackFrame = max ( now, (UnsignedInt)1 );
346
+ m_laserStatus = LASERSTATUS_NONE;
349
347
setLogicalStatus ( STATUS_READY_TO_FIRE );
350
348
m_specialPowerModule->setReadyFrame ( now );
351
349
}
350
+
352
351
m_startDecayFrame = m_startAttackFrame + data->m_totalFiringFrames ;
353
352
354
353
SpecialPowerModuleInterface *spmInterface = getObject ()->getSpecialPowerModule ( specialPowerTemplate );
0 commit comments