mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r23443) -Fix (r23413): Building of locks in SE failed.
This commit is contained in:
parent
390bc7aea3
commit
85ba182fde
|
@ -284,14 +284,16 @@ static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag
|
||||||
|
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
/* Update company infrastructure counts. */
|
/* Update company infrastructure counts. */
|
||||||
Company *c = Company::Get(_current_company);
|
Company *c = Company::GetIfValid(_current_company);
|
||||||
/* Counts for the water. */
|
if (c != NULL) {
|
||||||
c->infrastructure.water++;
|
/* Counts for the water. */
|
||||||
if (!IsWaterTile(tile - delta)) c->infrastructure.water++;
|
c->infrastructure.water++;
|
||||||
if (!IsWaterTile(tile + delta)) c->infrastructure.water++;
|
if (!IsWaterTile(tile - delta)) c->infrastructure.water++;
|
||||||
/* Count for the lock itself. */
|
if (!IsWaterTile(tile + delta)) c->infrastructure.water++;
|
||||||
c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock is three tiles.
|
/* Count for the lock itself. */
|
||||||
DirtyCompanyInfrastructureWindows(_current_company);
|
c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock is three tiles.
|
||||||
|
DirtyCompanyInfrastructureWindows(_current_company);
|
||||||
|
}
|
||||||
|
|
||||||
MakeLock(tile, _current_company, dir, wc_lower, wc_upper);
|
MakeLock(tile, _current_company, dir, wc_lower, wc_upper);
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
|
|
Loading…
Reference in New Issue