summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/newgrf_callbacks.h2
-rw-r--r--src/roadveh_cmd.cpp5
-rw-r--r--src/ship_cmd.cpp4
3 files changed, 10 insertions, 1 deletions
diff --git a/src/newgrf_callbacks.h b/src/newgrf_callbacks.h
index 22daba598..5e9ab78f7 100644
--- a/src/newgrf_callbacks.h
+++ b/src/newgrf_callbacks.h
@@ -279,7 +279,7 @@ enum CallbackID {
* Some callbacks are always used and don't have a mask.
*/
enum VehicleCallbackMask {
- CBM_VEHICLE_VISUAL_EFFECT = 0, ///< Visual effects and wagon power (trains only)
+ CBM_VEHICLE_VISUAL_EFFECT = 0, ///< Visual effects and wagon power (trains, road vehicles and ships)
CBM_VEHICLE_LENGTH = 1, ///< Vehicle length (trains and road vehicles)
CBM_VEHICLE_LOAD_AMOUNT = 2, ///< Load amount
CBM_VEHICLE_REFIT_CAPACITY = 3, ///< Cargo capacity after refit
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 5fa694909..c1ad847dc 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -188,6 +188,9 @@ void RoadVehUpdateCache(RoadVehicle *v)
u->rcache.cached_veh_length = GetRoadVehLength(u);
v->rcache.cached_total_length += u->rcache.cached_veh_length;
+ /* Update visual effect */
+ v->UpdateVisualEffect();
+
/* Invalidate the vehicle colour map */
u->colourmap = PAL_NONE;
}
@@ -1477,6 +1480,8 @@ static bool RoadVehController(RoadVehicle *v)
if (v->IsInDepot() && RoadVehLeaveDepot(v, true)) return true;
+ v->ShowVisualEffect();
+
/* Check how far the vehicle needs to proceed */
int j = RoadVehAccelerate(v);
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 5b4c7780a..718a5a6e7 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -156,6 +156,8 @@ static void CheckIfShipNeedsService(Vehicle *v)
void Ship::UpdateCache()
{
this->vcache.cached_max_speed = GetVehicleProperty(this, PROP_SHIP_SPEED, ShipVehInfo(this->engine_type)->max_speed);
+
+ this->UpdateVisualEffect();
}
Money Ship::GetRunningCost() const
@@ -446,6 +448,8 @@ static void ShipController(Ship *v)
CheckShipLeaveDepot(v);
+ v->ShowVisualEffect();
+
if (!ShipAccelerate(v)) return;
GetNewVehiclePosResult gp = GetNewVehiclePos(v);