diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index a6f558ece5..a682361bfa 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -5446,6 +5446,8 @@ CommandCost CmdTemplateReplaceVehicle(TileIndex tile, DoCommandFlag flags, uint3 } } + if (need_replacement || (need_refit && use_refit)) RegisterGameEvents(GEF_TBTR_REPLACEMENT); + /* define replacement behavior */ bool reuseDepot = tv->IsSetReuseDepotVehicles(); bool keepRemainders = tv->IsSetKeepRemainingVehicles(); diff --git a/src/vehicle.cpp b/src/vehicle.cpp index c92880e7a9..1c2fedd63b 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1388,8 +1388,6 @@ void CallVehicleTicks() bool leaveDepot = it->second; _vehicles_to_autoreplace.erase(it); - RegisterGameEvents(GEF_TBTR_REPLACEMENT); - /* Store the position of the effect as the vehicle pointer will become invalid later */ int x = t->x_pos; int y = t->y_pos;