summaryrefslogtreecommitdiff
path: root/src/object_cmd.cpp
diff options
context:
space:
mode:
authorSamuXarick <43006711+SamuXarick@users.noreply.github.com>2021-10-03 11:54:19 +0100
committerGitHub <noreply@github.com>2021-10-03 12:54:19 +0200
commite404d16929991d1eddd9d37b859d3813be7e18ed (patch)
tree0c6de857141d311dd827db95a9fbd39dee501128 /src/object_cmd.cpp
parente4ad6329891c9235336649ef4412b2ce0a073af8 (diff)
downloadopenttd-e404d16929991d1eddd9d37b859d3813be7e18ed.tar.xz
Fix #9591: Update station docking tiles upon placing a water object on a docking tile (#9594)
Diffstat (limited to 'src/object_cmd.cpp')
-rw-r--r--src/object_cmd.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp
index 14645f93d..cd080ca53 100644
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -32,6 +32,7 @@
#include "date_func.h"
#include "newgrf_debug.h"
#include "vehicle_func.h"
+#include "station_func.h"
#include "table/strings.h"
#include "table/object_land.h"
@@ -121,7 +122,9 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, u
Company::Get(owner)->infrastructure.water++;
DirtyCompanyInfrastructureWindows(owner);
}
+ bool remove = IsDockingTile(t);
MakeObject(t, owner, o->index, wc, Random());
+ if (remove) RemoveDockingTile(t);
MarkTileDirtyByTile(t);
}