# HG changeset patch # User peter1138 # Date 1181718882 0 # Node ID e7f939f0206dd51c426292d04dd2da37ab6b029a # Parent 12cc0502992a10449c6e866dfe46ca7de299ed37 (svn r10129) -Fix (r10111): Test for x == INVALID_COORD instead of v->tile == INVALID_TILE to determine if a vehicle should be removed from the has. diff -r 12cc0502992a -r e7f939f0206d src/vehicle.cpp --- a/src/vehicle.cpp Wed Jun 13 06:42:43 2007 +0000 +++ b/src/vehicle.cpp Wed Jun 13 07:14:42 2007 +0000 @@ -456,12 +456,12 @@ return NULL; } -static void UpdateNewVehiclePosHash(Vehicle *v) +static void UpdateNewVehiclePosHash(Vehicle *v, bool remove) { Vehicle **old_hash = v->old_new_hash; Vehicle **new_hash; - if (v->tile == INVALID_TILE || v->tile == 0) { + if (remove) { new_hash = NULL; } else { int x = GB(TileX(v->tile), HASH_RES, HASH_BITS); @@ -503,7 +503,7 @@ static void UpdateVehiclePosHash(Vehicle* v, int x, int y) { - UpdateNewVehiclePosHash(v); + UpdateNewVehiclePosHash(v, x == INVALID_COORD); Vehicle **old_hash, **new_hash; int old_x = v->left_coord; @@ -687,7 +687,6 @@ InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile); } - v->tile = INVALID_TILE; UpdateVehiclePosHash(v, INVALID_COORD, 0); v->next_hash = NULL; v->next_new_hash = NULL;