summaryrefslogtreecommitdiff
path: root/src/industry_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/industry_gui.cpp')
-rw-r--r--src/industry_gui.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 0f6d8ba62..a0177fea3 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -33,6 +33,7 @@
#include "company_base.h"
#include "core/geometry_func.hpp"
#include "core/random_func.hpp"
+#include "core/backup_type.hpp"
#include "table/strings.h"
#include "table/sprites.h"
@@ -522,12 +523,14 @@ public:
return;
}
- _current_company = OWNER_NONE;
+ Backup<CompanyByte> cur_company(_current_company, OWNER_NONE);
_generating_world = true;
_ignore_restrictions = true;
+
DoCommandP(tile, (InteractiveRandomRange(indsp->num_table) << 8) | this->selected_type, seed,
CMD_BUILD_INDUSTRY | CMD_MSG(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY), &CcBuildIndustry);
+ cur_company.Restore();
_ignore_restrictions = false;
_generating_world = false;
} else {