static bool ArmourSelected() { Team *team = NULL; Entity *entity = NULL; return g_app->m_location && (team = g_app->m_location->GetMyTeam()) && (entity = team->GetMyEntity()) && (entity->m_type == Entity::TypeArmour); }
static bool UnitSelected() { if( !g_app->m_location ) return false; Team *team = g_app->m_location->GetMyTeam(); if( !team ) return false; if( team->GetMyEntity() ) return true; Task *currentTask = g_app->m_taskManager->GetCurrentTask(); // if the task has just been ended or killed, it isnt valid if (currentTask && currentTask->m_state == Task::StateStopping ) return false; if( !currentTask ) return false; Unit *unit = team->GetMyUnit(); return unit != NULL; }