summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2012-01-02 12:07:42 +0000
committertruebrain <truebrain@openttd.org>2012-01-02 12:07:42 +0000
commit0e9a98619db6690954f5dd164d1546b1a79db05f (patch)
tree121ee81bc48f44004689b01e05fc1ceed5dd24ae
parent6ed84aff8d4f96f28c1b65b54f209803de7e23c3 (diff)
downloadopenttd-0e9a98619db6690954f5dd164d1546b1a79db05f.tar.xz
(svn r23711) -Codechange: don't chain the two vehicle hashes, but call them one by one
-rw-r--r--src/vehicle.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 1d162d502..176d07042 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -555,8 +555,6 @@ static Vehicle *_vehicle_position_hash[0x1000];
static void UpdateVehiclePosHash(Vehicle *v, int x, int y)
{
- UpdateNewVehiclePosHash(v, x == INVALID_COORD);
-
Vehicle **old_hash, **new_hash;
int old_x = v->coord.left;
int old_y = v->coord.top;
@@ -794,6 +792,7 @@ Vehicle::~Vehicle()
delete v;
UpdateVehiclePosHash(this, INVALID_COORD, 0);
+ UpdateNewVehiclePosHash(this, true);
DeleteVehicleNews(this->index, INVALID_STRING_ID);
DeleteNewGRFInspectWindow(GetGrfSpecFeature(this->type), this->index);
}
@@ -1395,6 +1394,8 @@ void VehicleEnterDepot(Vehicle *v)
*/
void VehicleMove(Vehicle *v, bool update_viewport)
{
+ UpdateNewVehiclePosHash(v, false);
+
int img = v->cur_image;
Point pt = RemapCoords(v->x_pos + v->x_offs, v->y_pos + v->y_offs, v->z_pos);
const Sprite *spr = GetSprite(img, ST_NORMAL);