summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorzuu <zuu@openttd.org>2013-06-09 12:19:09 +0000
committerzuu <zuu@openttd.org>2013-06-09 12:19:09 +0000
commit9aa1bf026443ddc65ab4381e86c294943ddc30d8 (patch)
tree82af61f4b6f346bd71046a5d6fa6bab1f49b3d34 /src/economy.cpp
parentbea60988c67b40fb5b3058990779a4d572511224 (diff)
downloadopenttd-9aa1bf026443ddc65ab4381e86c294943ddc30d8.tar.xz
(svn r25342) -Add: StoryPage data structures and GS API
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 7ae5daccb..552839192 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -46,6 +46,7 @@
#include "game/game.hpp"
#include "cargomonitor.h"
#include "goal_base.h"
+#include "story_base.h"
#include "table/strings.h"
#include "table/pricebase.h"
@@ -509,7 +510,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
if (si->owner == old_owner) si->owner = new_owner == INVALID_OWNER ? OWNER_NONE : new_owner;
}
- /* Remove Game Script created Goals and CargoMonitors. */
+ /* Remove Game Script created Goals, CargoMonitors and Story pages. */
Goal *g;
FOR_ALL_GOALS(g) {
if (g->company == old_owner) delete g;
@@ -518,6 +519,11 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
ClearCargoPickupMonitoring(old_owner);
ClearCargoDeliveryMonitoring(old_owner);
+ StoryPage *sp;
+ FOR_ALL_STORY_PAGES(sp) {
+ if (sp->company == old_owner) delete sp;
+ }
+
/* Change colour of existing windows */
if (new_owner != INVALID_OWNER) ChangeWindowOwner(old_owner, new_owner);