File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -405,14 +405,19 @@ void ActiveBody::attemptDamage( DamageInfo *damageInfo )
405405 }
406406 else
407407 {
408- // Removing the rider will scuttle the bike.
409- Object *rider = *(contain->getContainedItemsList ()->begin ());
410- ai->aiEvacuateInstantly ( TRUE , CMD_FROM_AI );
408+ // TheSuperHackers @bugfix Caball009 04/09/2025 Check whether a bike still has a rider.
409+ // A rider may dismount or be sniped off a bike when it's disabled, resulting in a bike object with an empty contain list.
410+ if ( !contain->getContainedItemsList ()->empty () )
411+ {
412+ // Removing the rider will scuttle the bike.
413+ Object* rider = *(contain->getContainedItemsList ()->begin ());
414+ ai->aiEvacuateInstantly (TRUE , CMD_FROM_AI);
411415
412- // Kill the rider.
413- if (damager)
414- damager->scoreTheKill ( rider );
415- rider->kill ();
416+ // Kill the rider.
417+ if (damager)
418+ damager->scoreTheKill (rider);
419+ rider->kill ();
420+ }
416421 }
417422 }
418423 else
You can’t perform that action at this time.
0 commit comments