Skip to content

Commit eb379b9

Browse files
committed
More opt
1 parent 1af9503 commit eb379b9

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,12 @@ void ParkingPlaceBehavior::calcPPInfo( ObjectID id, PPInfo *info )
410410

411411
for (std::vector<RunwayInfo>::iterator it = m_runways.begin(); it != m_runways.end(); ++it)
412412
{
413-
if (it->m_inUseBy == id && it->m_wasInLine)
413+
if (it->m_inUseBy == id)
414414
{
415-
info->runwayStart = info->runwayPrep;
415+
if (it->m_wasInLine)
416+
{
417+
info->runwayStart = info->runwayPrep;
418+
}
416419
break;
417420
}
418421
}
@@ -463,11 +466,14 @@ void ParkingPlaceBehavior::transferRunwayReservationToNextInLineForTakeoff(Objec
463466
purgeDead();
464467
for (std::vector<RunwayInfo>::iterator it = m_runways.begin(); it != m_runways.end(); ++it)
465468
{
466-
if (it->m_inUseBy == id && it->m_nextInLineForTakeoff != INVALID_ID)
469+
if (it->m_inUseBy == id)
467470
{
468-
it->m_inUseBy = it->m_nextInLineForTakeoff;
469-
it->m_wasInLine = true;
470-
it->m_nextInLineForTakeoff = INVALID_ID;
471+
if (it->m_nextInLineForTakeoff != INVALID_ID)
472+
{
473+
it->m_inUseBy = it->m_nextInLineForTakeoff;
474+
it->m_wasInLine = true;
475+
it->m_nextInLineForTakeoff = INVALID_ID;
476+
}
471477
break;
472478
}
473479
}

0 commit comments

Comments
 (0)