summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-08-12 14:20:02 +0000
committerfrosch <frosch@openttd.org>2010-08-12 14:20:02 +0000
commitb8c401f64442dad1102af4966a98f29a3dd5014a (patch)
tree266665ae21b11b913066d533c3a709c15ba39b23 /src
parentb9efd3c04e3e2b5cc0b678682f3eaa164fd9ae07 (diff)
downloadopenttd-b8c401f64442dad1102af4966a98f29a3dd5014a.tar.xz
(svn r20469) -Fix (r20227): Building statues used different companys for CMD_LANDSCAPE_CLEAR during testrun and DC_EXEC.
Diffstat (limited to 'src')
-rw-r--r--src/town_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 755544296..538037142 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -2504,7 +2504,9 @@ static CommandCost TownActionBuildStatue(Town *t, DoCommandFlag flags)
TileIndex tile = t->xy;
if (CircularTileSearch(&tile, 9, SearchTileForStatue, NULL)) {
if (flags & DC_EXEC) {
+ Backup<CompanyByte> cur_company(_current_company, OWNER_NONE, FILE_LINE);
DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
+ cur_company.Restore();
BuildObject(OBJECT_STATUE, tile, _current_company, t->index);
SetBit(t->statues, _current_company); // Once found and built, "inform" the Town.
MarkTileDirtyByTile(tile);