Open
Description
The return statement is unexpected.
case GameMessage::MSG_CANCEL_UNIT_CREATE:
{
#if RETAIL_COMPATIBLE_AIGROUP
Object *producer = getSingleObjectFromSelection(currentlySelectedGroup);
#else
Object *producer = getSingleObjectFromSelection(currentlySelectedGroup.Peek());
#endif
ProductionID productionID = (ProductionID)msg->getArgument( 0 )->integer;
// sanity
if( producer == NULL )
break;
// sanity, the player must control the producer
if( producer->getControllingPlayer() != thisPlayer )
break;
// get the unit production interface
ProductionUpdateInterface *pu = producer->getProductionUpdateInterface();
if( pu == NULL )
return; // <------ THIS RETURN IS UNEXPECTED
// cancel the production
pu->cancelUnitCreate( productionID );
break;
} // end GameMessage::MSG_CANCEL_UNIT_CREATE