Fix DeleteVisibleTrain being called on virtual trains
Add assertion to check for this case
This commit is contained in:
@@ -407,7 +407,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
|
||||
if (v->owner == old_owner && IsCompanyBuildableVehicleType(v->type)) {
|
||||
if (new_owner == INVALID_OWNER) {
|
||||
if (v->Previous() == NULL) {
|
||||
if (_settings_game.economy.infrastructure_sharing[VEH_TRAIN] && v->type == VEH_TRAIN && Train::From(v)->IsFrontEngine()) {
|
||||
if (_settings_game.economy.infrastructure_sharing[VEH_TRAIN] && v->type == VEH_TRAIN && Train::From(v)->IsFrontEngine() && !Train::From(v)->IsVirtual()) {
|
||||
DeleteVisibleTrain(Train::From(v));
|
||||
} else {
|
||||
delete v;
|
||||
|
Reference in New Issue
Block a user