vehicle.c
changeset 2319 9902d3ffa309
parent 2296 6e883aaa77e0
child 2386 c5cc666c869d
--- a/vehicle.c	Mon Aug 08 20:27:05 2005 +0000
+++ b/vehicle.c	Mon Aug 08 21:35:27 2005 +0000
@@ -165,20 +165,18 @@
 void VehiclePositionChanged(Vehicle *v)
 {
 	int img = v->cur_image;
-	const SpriteDimension *sd;
 	Point pt = RemapCoords(v->x_pos + v->x_offs, v->y_pos + v->y_offs, v->z_pos);
+	const Sprite* spr = GetSprite(img);
 
-	sd = GetSpriteDimension(img);
-
-	pt.x += sd->xoffs;
-	pt.y += sd->yoffs;
+	pt.x += spr->x_offs;
+	pt.y += spr->y_offs;
 
 	UpdateVehiclePosHash(v, pt.x, pt.y);
 
 	v->left_coord = pt.x;
 	v->top_coord = pt.y;
-	v->right_coord = pt.x + sd->xsize + 2;
-	v->bottom_coord = pt.y + sd->ysize + 2;
+	v->right_coord = pt.x + spr->width + 2;
+	v->bottom_coord = pt.y + spr->height + 2;
 }
 
 // Called after load to update coordinates