(svn r17121) -Fix [FS#3060]: Update vehicle position cache when the vehicle sprite changes.

This commit is contained in:
frosch
2009-08-08 18:45:12 +00:00
parent 0644123d51
commit 32a47df09a
5 changed files with 38 additions and 52 deletions

View File

@@ -229,8 +229,7 @@ static void HandleBrokenShip(Vehicle *v)
void Ship::MarkDirty()
{
this->cur_image = this->GetImage(this->direction);
MarkSingleVehicleDirty(this);
this->UpdateViewport(false, false);
}
static void PlayShipSound(const Vehicle *v)
@@ -283,9 +282,7 @@ void Ship::UpdateDeltaXY(Direction direction)
void RecalcShipStuff(Vehicle *v)
{
v->UpdateDeltaXY(v->direction);
v->cur_image = v->GetImage(v->direction);
v->MarkDirty();
v->UpdateViewport(false, true);
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
}
@@ -708,9 +705,7 @@ static void ShipController(Ship *v)
v->z_pos = GetSlopeZ(gp.x, gp.y);
getout:
v->UpdateDeltaXY(dir);
v->cur_image = v->GetImage(dir);
VehicleMove(v, true);
v->UpdateViewport(true, true);
return;
reverse_direction: