summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-10-04 19:23:43 +0000
committerrubidium <rubidium@openttd.org>2014-10-04 19:23:43 +0000
commit4978ece6ee6ff1d48057f3cb225a3810f4454a33 (patch)
treeb8a16bd99ed787e761443f761c24c12f2e508fc0
parentd4a9b3acedb52bfe6d59aec6fe9c2a83996f066d (diff)
downloadopenttd-4978ece6ee6ff1d48057f3cb225a3810f4454a33.tar.xz
(svn r26955) -Fix [FS#6126]: owner of road depot road types were not properly changed upon bankruptcy causing crashes when trying to remove the depot in certain situations
-rw-r--r--docs/landscape.html3
-rw-r--r--docs/landscape_grid.html4
-rw-r--r--src/road_cmd.cpp5
3 files changed, 9 insertions, 3 deletions
diff --git a/docs/landscape.html b/docs/landscape.html
index 2101ea965..f60e859fc 100644
--- a/docs/landscape.html
+++ b/docs/landscape.html
@@ -549,6 +549,7 @@
</tr>
</table>
</li>
+ <li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of road type 1 (tram); OWNER_NONE (<tt>10</tt>) is stored as OWNER_TOWN (<tt>0F</tt>)
<li>m5 bits 7 clear: road or level-crossing
<ul>
<li>m6 bits 5..3:
@@ -583,7 +584,6 @@
</tr>
</table>
</li>
- <li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of road type 1 (tram); OWNER_NONE (<tt>10</tt>) is stored as OWNER_TOWN (<tt>0F</tt>)
<li>m5 bit 6 clear: road
<ul>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
@@ -673,6 +673,7 @@
</tr>
</table>
</li>
+ <li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
</ul>
</li>
</ul>
diff --git a/docs/landscape_grid.html b/docs/landscape_grid.html
index 0e0e86e34..98351fcdc 100644
--- a/docs/landscape_grid.html
+++ b/docs/landscape_grid.html
@@ -158,11 +158,11 @@ the array so you can quickly see what is used and what is not.
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
- <td class="bits"><span class="free">OOOO OOOO</span></td>
+ <td class="bits">XXXX <span class="free">OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
- <td class="bits">XXX<span class="free">O OOOO</span></td>
+ <td class="bits">XXX<span class="free">O</span> XXXX</td>
</tr>
<tr>
<td>3</td>
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index cdcedf460..e56633696 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -1762,6 +1762,11 @@ static void ChangeTileOwner_Road(TileIndex tile, Owner old_owner, Owner new_owne
Company::Get(new_owner)->infrastructure.road[rt] += 2;
SetTileOwner(tile, new_owner);
+ for (RoadType rt = ROADTYPE_ROAD; rt < ROADTYPE_END; rt++) {
+ if (GetRoadOwner(tile, rt) == old_owner) {
+ SetRoadOwner(tile, rt, new_owner);
+ }
+ }
}
}
return;