diff options
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r-- | src/openttd.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index 06b343309..cf4709c5d 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1029,53 +1029,53 @@ void StateGameLoop() CallWindowTickEvent(); NewsLoop(); } else { -#ifdef DEBUG_DUMP_COMMANDS - Vehicle *v; - FOR_ALL_VEHICLES(v) { - if (v != v->First()) continue; - - switch (v->type) { - case VEH_ROAD: { - extern byte GetRoadVehLength(const Vehicle *v); - if (GetRoadVehLength(v) != v->u.road.cached_veh_length) { - printf("cache mismatch: vehicle %i, company %i, unit number %i\n", v->index, (int)v->owner, v->unitnumber); - } - } break; + if (_debug_desync_level > 1) { + Vehicle *v; + FOR_ALL_VEHICLES(v) { + if (v != v->First()) continue; + + switch (v->type) { + case VEH_ROAD: { + extern byte GetRoadVehLength(const Vehicle *v); + if (GetRoadVehLength(v) != v->u.road.cached_veh_length) { + DEBUG(desync, 2, "cache mismatch: vehicle %i, company %i, unit number %i\n", v->index, (int)v->owner, v->unitnumber); + } + } break; - case VEH_TRAIN: { - uint length = 0; - for (Vehicle *u = v; u != NULL; u = u->Next()) length++; + case VEH_TRAIN: { + uint length = 0; + for (Vehicle *u = v; u != NULL; u = u->Next()) length++; - VehicleRail *wagons = MallocT<VehicleRail>(length); - length = 0; - for (Vehicle *u = v; u != NULL; u = u->Next()) wagons[length++] = u->u.rail; + VehicleRail *wagons = MallocT<VehicleRail>(length); + length = 0; + for (Vehicle *u = v; u != NULL; u = u->Next()) wagons[length++] = u->u.rail; - TrainConsistChanged(v, true); + TrainConsistChanged(v, true); - length = 0; - for (Vehicle *u = v; u != NULL; u = u->Next()) { - if (memcmp(&wagons[length], &u->u.rail, sizeof(VehicleRail)) != 0) { - printf("cache mismatch: vehicle %i, company %i, unit number %i, wagon %i\n", v->index, (int)v->owner, v->unitnumber, length); + length = 0; + for (Vehicle *u = v; u != NULL; u = u->Next()) { + if (memcmp(&wagons[length], &u->u.rail, sizeof(VehicleRail)) != 0) { + DEBUG(desync, 2, "cache mismatch: vehicle %i, company %i, unit number %i, wagon %i\n", v->index, (int)v->owner, v->unitnumber, length); + } + length++; } - length++; - } - free(wagons); - } break; + free(wagons); + } break; - case VEH_AIRCRAFT: { - uint speed = v->u.air.cached_max_speed; - UpdateAircraftCache(v); - if (speed != v->u.air.cached_max_speed) { - printf("cache mismatch: vehicle %i, company %i, unit number %i\n", v->index, (int)v->owner, v->unitnumber); - } - } break; + case VEH_AIRCRAFT: { + uint speed = v->u.air.cached_max_speed; + UpdateAircraftCache(v); + if (speed != v->u.air.cached_max_speed) { + DEBUG(desync, 2, "cache mismatch: vehicle %i, company %i, unit number %i\n", v->index, (int)v->owner, v->unitnumber); + } + } break; - default: - break; + default: + break; + } } } -#endif /* All these actions has to be done from OWNER_NONE * for multiplayer compatibility */ |