Fix false positive in ValidateVehicleTileHash

pull/135/head
Jonathan G Rennison 4 years ago
parent cb6a01cab3
commit f3145030b7

@ -735,7 +735,7 @@ void UpdateVehicleTileHash(Vehicle *v, bool remove)
bool ValidateVehicleTileHash(const Vehicle *v)
{
if (v->type == VEH_TRAIN && Train::From(v)->IsVirtual()) return v->hash_tile_current == nullptr;
if ((v->type == VEH_TRAIN && Train::From(v)->IsVirtual()) || v->type >= VEH_COMPANY_END) return v->hash_tile_current == nullptr;
int x = GB(TileX(v->tile), HASH_RES, HASH_BITS);
int y = GB(TileY(v->tile), HASH_RES, HASH_BITS) << HASH_BITS;

Loading…
Cancel
Save