Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Include/GameLogic/AI.h
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ class AIGroup : public MemoryPoolObject, public Snapshot
void computeIndividualDestination( Coord3D *dest, const Coord3D *groupDest,
Object *obj, const Coord3D *center, Bool isFormation ); ///< compute destination of individual object, based on group destination
Int getCount(); ///< return the number of objects in the group
Bool isEmpty(); ///< returns true if the group has no members
Bool isEmpty() const; ///< returns true if the group has no members
void queueUpgrade( const UpgradeTemplate *upgrade ); ///< queue an upgrade

void add( Object *obj ); ///< add object to group
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ Int AIGroup::getCount()
/**
* Returns true if the group has no members
*/
Bool AIGroup::isEmpty()
Bool AIGroup::isEmpty() const
{
return m_memberList.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static void doSetRallyPoint( Object *obj, const Coord3D& pos )

static Object * getSingleObjectFromSelection(const AIGroup *currentlySelectedGroup)
{
if( currentlySelectedGroup )
if( currentlySelectedGroup && !currentlySelectedGroup->isEmpty() )
Comment thread
xezon marked this conversation as resolved.
{
const VecObjectID& selectedObjects = currentlySelectedGroup->getAllIDs();
DEBUG_ASSERTCRASH(selectedObjects.size() == 1, ("Trying to get single object from multiple selection!"));
Comment thread
xezon marked this conversation as resolved.
Expand Down Expand Up @@ -532,7 +532,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData )
Object *targetObject = findObjectByID( msg->getArgument( 0 )->objectID );

// issue command for either single object or for selected group
if( currentlySelectedGroup )
if( currentlySelectedGroup && targetObject )
currentlySelectedGroup->groupCombatDrop( targetObject,
*targetObject->getPosition(),
CMD_FROM_PLAYER );
Expand Down
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Include/GameLogic/AI.h
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ class AIGroup : public MemoryPoolObject, public Snapshot
void computeIndividualDestination( Coord3D *dest, const Coord3D *groupDest,
Object *obj, const Coord3D *center, Bool isFormation ); ///< compute destination of individual object, based on group destination
Int getCount(); ///< return the number of objects in the group
Bool isEmpty(); ///< returns true if the group has no members
Bool isEmpty() const; ///< returns true if the group has no members
void queueUpgrade( const UpgradeTemplate *upgrade ); ///< queue an upgrade

void add( Object *obj ); ///< add object to group
Expand Down
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ Int AIGroup::getCount()
/**
* Returns true if the group has no members
*/
Bool AIGroup::isEmpty()
Bool AIGroup::isEmpty() const
{
return m_memberList.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static void doSetRallyPoint( Object *obj, const Coord3D& pos )

static Object * getSingleObjectFromSelection(const AIGroup *currentlySelectedGroup)
{
if( currentlySelectedGroup )
if( currentlySelectedGroup && !currentlySelectedGroup->isEmpty() )
{
const VecObjectID& selectedObjects = currentlySelectedGroup->getAllIDs();
DEBUG_ASSERTCRASH(selectedObjects.size() == 1, ("Trying to get single object from multiple selection!"));
Expand Down Expand Up @@ -541,7 +541,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData )
Object *targetObject = findObjectByID( msg->getArgument( 0 )->objectID );

// issue command for either single object or for selected group
if( currentlySelectedGroup )
if( currentlySelectedGroup && targetObject )
currentlySelectedGroup->groupCombatDrop( targetObject,
*targetObject->getPosition(),
CMD_FROM_PLAYER );
Expand Down
Loading