(svn r23411) -Add: Company infrastructure counts for rail.
This commit is contained in:
@@ -1115,6 +1115,22 @@ void SwitchToMode(SwitchMode new_mode)
|
||||
*/
|
||||
static void CheckCaches()
|
||||
{
|
||||
/* Check company infrastructure cache. */
|
||||
SmallVector<CompanyInfrastructure, 4> old_infrastructure;
|
||||
Company *c;
|
||||
FOR_ALL_COMPANIES(c) MemCpyT(old_infrastructure.Append(), &c->infrastructure);
|
||||
|
||||
extern void AfterLoadCompanyStats();
|
||||
AfterLoadCompanyStats();
|
||||
|
||||
uint i = 0;
|
||||
FOR_ALL_COMPANIES(c) {
|
||||
if (MemCmpT(old_infrastructure.Get(i), &c->infrastructure) != 0) {
|
||||
DEBUG(desync, 2, "infrastructure cache mismatch: company %i", c->index);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Return here so it is easy to add checks that are run
|
||||
* always to aid testing of caches. */
|
||||
if (_debug_desync_level <= 1) return;
|
||||
|
Reference in New Issue
Block a user