summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-08-08 20:53:36 +0000
committersmatz <smatz@openttd.org>2009-08-08 20:53:36 +0000
commit13e23141b418214db51e1463bb3696a4e6d87129 (patch)
tree3b092f293fd5fdc1c1dd17120ba874d919824bf0 /src/economy.cpp
parent8d809d5f4c21afbed4bbeb0388d42a9c5718a755 (diff)
downloadopenttd-13e23141b418214db51e1463bb3696a4e6d87129.tar.xz
(svn r17124) -Codechange: store subsidies in a pool (instead of an array)
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index f8bba522c..94674a5b6 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -332,12 +332,13 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
FOR_ALL_SUBSIDIES(s) {
if (s->awarded == old_owner) {
if (new_owner == INVALID_OWNER) {
- DeleteSubsidy(s);
+ delete s;
} else {
s->awarded = new_owner;
}
}
}
+ if (new_owner == INVALID_OWNER) RebuildSubsidisedSourceAndDestinationCache();
/* Take care of rating in towns */
FOR_ALL_TOWNS(t) {