diff options
author | frosch <frosch@openttd.org> | 2009-08-08 18:45:12 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-08-08 18:45:12 +0000 |
commit | efcaefd178410c303ae17db17200c300e4379298 (patch) | |
tree | 1c48cba6fda8b05d4663d3164ef58d008ca7ca95 /src/ship_cmd.cpp | |
parent | 87014fec05a845cc9eab22ac33b2d7e7440b0dcc (diff) | |
download | openttd-efcaefd178410c303ae17db17200c300e4379298.tar.xz |
(svn r17121) -Fix [FS#3060]: Update vehicle position cache when the vehicle sprite changes.
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r-- | src/ship_cmd.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 9385259b6..1a524f67d 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -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: |