The following tick code incorrectly sends MissionSuccess although no aircraft is alive. This error is more critical because it is also visible in the final output. To fix this, check if the code enters the foreach loop.
// Check for mission success = all planes with position.y < offset
bool allAircraftsDone = true;
bool allDestroyed = true;
FOREACH(auto pair, mAircraftInfo)
{
allDestroyed = false;
// As long as one player has not crossed the finish line yet, set variable to false
if (pair.second.position.y > 0.f)
allAircraftsDone = false;
}
if (!allDestroyed && allAircraftsDone)
{
sf::Packet missionSuccessPacket;
missionSuccessPacket << static_cast<sf::Int32>(Server::MissionSuccess);
sendToAll(missionSuccessPacket);
}