mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
TBTR: Fix wrong replacement count when train only differed by refit
This commit is contained in:
parent
422bcc3e26
commit
78bf7c43e5
@ -280,11 +280,12 @@ void NeutralizeStatus(Train *t)
|
||||
TBTRDiffFlags TrainTemplateDifference(const Train *t, const TemplateVehicle *tv)
|
||||
{
|
||||
TBTRDiffFlags diff = TBTRDF_NONE;
|
||||
const bool check_refit_as_template = tv->refit_as_template;
|
||||
while (t != nullptr && tv != nullptr) {
|
||||
if (t->engine_type != tv->engine_type) {
|
||||
return TBTRDF_ALL;
|
||||
}
|
||||
if (tv->refit_as_template && (t->cargo_type != tv->cargo_type || t->cargo_subtype != tv->cargo_subtype)) {
|
||||
if (check_refit_as_template && (t->cargo_type != tv->cargo_type || t->cargo_subtype != tv->cargo_subtype)) {
|
||||
diff |= TBTRDF_REFIT;
|
||||
}
|
||||
if (HasBit(t->flags, VRF_REVERSE_DIRECTION) != HasBit(tv->ctrl_flags, TVCF_REVERSED)) {
|
||||
|
Loading…
Reference in New Issue
Block a user