(svn r16633) -Codechange: remove checks for consistency of newpool

pull/155/head
smatz 15 years ago
parent 45312433b6
commit 9ec6fc8a61

@ -2038,10 +2038,7 @@ 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(Vehicle::Get(index) == this);
assert(IsNormalAircraft(this));
}
return true;

@ -1046,55 +1046,6 @@ void SwitchToMode(SwitchMode new_mode)
}
#include "depot_base.h"
#include "autoreplace_base.h"
#include "waypoint.h"
#include "network/core/tcp_game.h"
#include "network/network_base.h"
/** Make sure everything is valid. Will be removed in future. */
static void CheckPools()
{
const Depot *d;
FOR_ALL_DEPOTS(d) assert(IsRoadDepotTile(d->xy) || IsRailDepotTile(d->xy) || IsShipDepotTile(d->xy) || IsHangarTile(d->xy));
const Industry *i;
FOR_ALL_INDUSTRIES(i) assert(IsValidTile(i->xy));
const Engine *e;
FOR_ALL_ENGINES(e) assert(e->info.climates != 0);
const Order *o;
FOR_ALL_ORDERS(o) assert(!o->IsType(OT_NOTHING));
const OrderList *ol;
FOR_ALL_ORDER_LISTS(ol) assert(ol->GetNumOrders() != INVALID_VEH_ORDER_ID && ol->GetNumVehicles() != 0);
const Town *t;
FOR_ALL_TOWNS(t) assert(IsValidTile(t->xy));
const Group *g;
FOR_ALL_GROUPS(g) assert(g->owner != INVALID_OWNER);
const EngineRenew *er;
FOR_ALL_ENGINE_RENEWS(er) assert(er->from != INVALID_ENGINE);
const Waypoint *wp;
FOR_ALL_WAYPOINTS(wp) assert(IsValidTile(wp->xy));
const Company *c;
FOR_ALL_COMPANIES(c) assert(c->name_1 != 0);
const CargoPacket *cp;
FOR_ALL_CARGOPACKETS(cp) assert(cp->count != 0);
#ifdef ENABLE_NETWORK
const NetworkClientSocket *ncs;
FOR_ALL_CLIENT_SOCKETS(ncs) assert(ncs->IsConnected());
const NetworkClientInfo *nci;
FOR_ALL_CLIENT_INFOS(nci) assert(nci->client_id != INVALID_CLIENT_ID);
#endif
const Station *st;
FOR_ALL_STATIONS(st) assert(IsValidTile(st->xy));
const RoadStop *rs;
FOR_ALL_ROADSTOPS(rs) assert(IsValidTile(rs->xy));
const Sign *si;
FOR_ALL_SIGNS(si) assert(si->owner != INVALID_OWNER);
const Vehicle *v;
FOR_ALL_VEHICLES(v) assert(v->type != VEH_INVALID);
FOR_ALL_ORDER_LISTS(ol) ol->DebugCheckSanity();
}
/**
* State controlling game loop.
* The state must not be changed from anywhere but here.
@ -1109,8 +1060,6 @@ void StateGameLoop()
}
if (IsGeneratingWorld()) return;
CheckPools();
ClearStorageChanges(false);
if (_game_mode == GM_EDITOR) {

@ -4446,14 +4446,8 @@ bool Train::Tick()
this->current_order_time++;
VehicleID index = this->index;
if (!TrainLocoHandler(this, false)) return false;
/* make sure vehicle wasn't deleted. */
assert(Vehicle::Get(index) == this);
assert(IsFrontEngine(this));
return TrainLocoHandler(this, true);
} else if (IsFreeWagon(this) && (this->vehstatus & VS_CRASHED)) {
/* Delete flooded standalone wagon chain */

Loading…
Cancel
Save