TBTR: Fix incorrect deletion of template vehicles when deleting company
(cherry picked from commit fff3018b42
)
This commit is contained in:
@@ -490,7 +490,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
|
|||||||
if (new_owner == INVALID_OWNER) {
|
if (new_owner == INVALID_OWNER) {
|
||||||
TemplateVehicle *tv;
|
TemplateVehicle *tv;
|
||||||
FOR_ALL_TEMPLATES(tv) {
|
FOR_ALL_TEMPLATES(tv) {
|
||||||
if (tv->owner == old_owner) {
|
if (tv->owner == old_owner && tv->Prev() == nullptr) {
|
||||||
TemplateReplacement *tr;
|
TemplateReplacement *tr;
|
||||||
FOR_ALL_TEMPLATE_REPLACEMENTS(tr) {
|
FOR_ALL_TEMPLATE_REPLACEMENTS(tr) {
|
||||||
if (tr->Template() == tv->index) {
|
if (tr->Template() == tv->index) {
|
||||||
|
Reference in New Issue
Block a user