TBTR: Avoid unnecessary iterations of template replacement pool

This commit is contained in:
Jonathan G Rennison
2020-01-16 01:16:08 +00:00
parent 5a3b67c5c3
commit 424813446f
7 changed files with 62 additions and 24 deletions

View File

@@ -500,6 +500,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
delete tv;
}
}
ReindexTemplateReplacements();
} else {
for (TemplateVehicle *tv : TemplateVehicle::Iterate()) {
if (tv->owner == old_owner) tv->owner = new_owner;