(svn r16378) -Codechange: replace OldPool with simpler Pool. Compilation time, binary size and run time (with asserts disabled) should be improved

This commit is contained in:
smatz
2009-05-22 15:13:50 +00:00
parent 04723b240e
commit 62a7948af0
69 changed files with 834 additions and 995 deletions

View File

@@ -589,8 +589,11 @@ static void CheckIfAircraftNeedsService(Vehicle *v)
}
const Station *st = Station::Get(v->current_order.GetDestination());
assert(st != NULL);
/* only goto depot if the target airport has terminals (eg. it is airport) */
if (st->IsValid() && st->airport_tile != INVALID_TILE && st->Airport()->terminals != NULL) {
if (st->airport_tile != INVALID_TILE && st->Airport()->terminals != NULL) {
// printf("targetairport = %d, st->index = %d\n", v->u.air.targetairport, st->index);
// v->u.air.targetairport = st->index;
v->current_order.MakeGoToDepot(st->index, ODTFB_SERVICE);
@@ -1535,7 +1538,7 @@ static void AircraftEventHandler_AtTerminal(Vehicle *v, const AirportFTAClass *a
return;
}
if (!v->current_order.IsValid()) return;
if (v->current_order.IsType(OT_NOTHING)) return;
/* if the block of the next position is busy, stay put */
if (AirportHasBlock(v, &apc->layout[v->u.air.pos], apc)) return;
@@ -2036,8 +2039,9 @@ bool Aircraft::Tick()
for (uint i = 0; i != 2; i++) {
/* stop if the aircraft was deleted */
VehicleID index = this->index;
if (!AircraftEventHandler(this, i)) return false;
assert(this->IsValid());
assert(Vehicle::Get(index) == this);
assert(IsNormalAircraft(this));
}