src/vehicle.cpp
branchnoai
changeset 9641 855e32c08c9b
parent 9631 8a2d1c2ceb88
child 9686 d3c195c226f9
--- a/src/vehicle.cpp	Thu Jul 12 15:52:17 2007 +0000
+++ b/src/vehicle.cpp	Fri Jul 13 09:18:50 2007 +0000
@@ -471,8 +471,8 @@
 	if (remove) {
 		new_hash = NULL;
 	} else {
-		int x = GB(TileX(v->tile), HASH_RES, HASH_BITS);
-		int y = GB(TileY(v->tile), HASH_RES, HASH_BITS) << HASH_BITS;
+		int x = GB(v->x_pos / TILE_SIZE, HASH_RES, HASH_BITS);
+		int y = GB(v->y_pos / TILE_SIZE, HASH_RES, HASH_BITS) << HASH_BITS;
 		new_hash = &_new_vehicle_position_hash[(x + y) & TOTAL_HASH_MASK];
 	}
 
@@ -675,6 +675,9 @@
 {
 	if (IsValidStationID(v->last_station_visited)) {
 		GetStation(v->last_station_visited)->loading_vehicles.remove(v);
+
+		HideFillingPercent(v->fill_percent_te_id);
+		v->fill_percent_te_id = INVALID_TE_ID;
 	}
 
 	if (IsEngineCountable(v)) {