Skip to content

Commit c77cf55

Browse files
committed
Replicate in Generals
1 parent eb379b9 commit c77cf55

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,13 @@ Bool ParkingPlaceBehavior::reserveSpace(ObjectID id, Real parkingOffset, Parking
352352

353353
for (std::vector<RunwayInfo>::iterator it = m_runways.begin(); it != m_runways.end(); ++it)
354354
{
355-
if (it->m_inUseBy == id && it->m_wasInLine)
355+
if (it->m_inUseBy == id)
356356
{
357-
info->runwayStart = info->runwayPrep;
357+
if (it->m_wasInLine)
358+
{
359+
info->runwayStart = info->runwayPrep;
360+
}
361+
break;
358362
}
359363
}
360364

@@ -383,6 +387,7 @@ void ParkingPlaceBehavior::releaseSpace(ObjectID id)
383387
it->m_postponedRunwayReservationForTakeoff = false;
384388
if (pu)
385389
pu->setHoldDoorOpen(it->m_door, false);
390+
break;
386391
}
387392
}
388393
}
@@ -402,11 +407,15 @@ void ParkingPlaceBehavior::transferRunwayReservationToNextInLineForTakeoff(Objec
402407
purgeDead();
403408
for (std::vector<RunwayInfo>::iterator it = m_runways.begin(); it != m_runways.end(); ++it)
404409
{
405-
if (it->m_inUseBy == id && it->m_nextInLineForTakeoff != INVALID_ID)
410+
if (it->m_inUseBy == id)
406411
{
407-
it->m_inUseBy = it->m_nextInLineForTakeoff;
408-
it->m_wasInLine = true;
409-
it->m_nextInLineForTakeoff = INVALID_ID;
412+
if (it->m_nextInLineForTakeoff != INVALID_ID)
413+
{
414+
it->m_inUseBy = it->m_nextInLineForTakeoff;
415+
it->m_wasInLine = true;
416+
it->m_nextInLineForTakeoff = INVALID_ID;
417+
}
418+
break;
410419
}
411420
}
412421
}

0 commit comments

Comments
 (0)