Only set TBTR replacement game event flag when replacement action occurs
This commit is contained in:
@@ -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 */
|
/* define replacement behavior */
|
||||||
bool reuseDepot = tv->IsSetReuseDepotVehicles();
|
bool reuseDepot = tv->IsSetReuseDepotVehicles();
|
||||||
bool keepRemainders = tv->IsSetKeepRemainingVehicles();
|
bool keepRemainders = tv->IsSetKeepRemainingVehicles();
|
||||||
|
@@ -1388,8 +1388,6 @@ void CallVehicleTicks()
|
|||||||
bool leaveDepot = it->second;
|
bool leaveDepot = it->second;
|
||||||
_vehicles_to_autoreplace.erase(it);
|
_vehicles_to_autoreplace.erase(it);
|
||||||
|
|
||||||
RegisterGameEvents(GEF_TBTR_REPLACEMENT);
|
|
||||||
|
|
||||||
/* Store the position of the effect as the vehicle pointer will become invalid later */
|
/* Store the position of the effect as the vehicle pointer will become invalid later */
|
||||||
int x = t->x_pos;
|
int x = t->x_pos;
|
||||||
int y = t->y_pos;
|
int y = t->y_pos;
|
||||||
|
Reference in New Issue
Block a user