summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
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);