mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-07 06:46:43 +00:00
(svn r8157) -Fix (r3136): moving cargo during auto replaces did not update the cached vehicle weight for trains properly. This caused (in network games) the server to have a different cached vehicle weight than newly joined clients would have, which causes desyncs.
This commit is contained in:
parent
ccbe68d5bc
commit
f3796eee66
@ -1901,6 +1901,14 @@ static void MoveVehicleCargo(Vehicle *dest, Vehicle *source)
|
|||||||
} while (source->cargo_count > 0 && (dest = dest->next) != NULL);
|
} while (source->cargo_count > 0 && (dest = dest->next) != NULL);
|
||||||
dest = v;
|
dest = v;
|
||||||
} while ((source = source->next) != NULL);
|
} while ((source = source->next) != NULL);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The of the train will be incorrect at this moment. This is due
|
||||||
|
* to the fact that removing the old wagon updates the weight of
|
||||||
|
* the complete train, which is without the weight of cargo we just
|
||||||
|
* moved back into some (of the) new wagon(s).
|
||||||
|
*/
|
||||||
|
if (dest->type == VEH_Train) TrainConsistChanged(dest->first);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool VerifyAutoreplaceRefitForOrders(const Vehicle *v, const EngineID engine_type)
|
static bool VerifyAutoreplaceRefitForOrders(const Vehicle *v, const EngineID engine_type)
|
||||||
|
Loading…
Reference in New Issue
Block a user