mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
Check vehicle prev/next pointer consistency in CheckCaches
This commit is contained in:
parent
34d7f12a70
commit
cb5a86754e
@ -72,6 +72,7 @@
|
||||
#include "bridge_signal_map.h"
|
||||
#include "zoning.h"
|
||||
#include "cargopacket.h"
|
||||
#include "tbtr_template_vehicle.h"
|
||||
|
||||
#include "linkgraph/linkgraphschedule.h"
|
||||
#include "tracerestrict.h"
|
||||
@ -1498,6 +1499,16 @@ void CheckCaches(bool force_check)
|
||||
|
||||
extern void ValidateVehicleTickCaches();
|
||||
ValidateVehicleTickCaches();
|
||||
|
||||
FOR_ALL_VEHICLES(v) {
|
||||
if (v->Previous()) assert_msg(v->Previous()->Next() == v, "%u", v->index);
|
||||
if (v->Next()) assert_msg(v->Next()->Previous() == v, "%u", v->index);
|
||||
}
|
||||
const TemplateVehicle *tv;
|
||||
FOR_ALL_TEMPLATES(tv) {
|
||||
if (tv->Prev()) assert_msg(tv->Prev()->Next() == tv, "%u", tv->index);
|
||||
if (tv->Next()) assert_msg(tv->Next()->Prev() == tv, "%u", tv->index);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user