forked from mirror/OpenTTD
(svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner
This commit is contained in:
@@ -494,7 +494,7 @@ static void ShowBuildRoadVehWindow(TileIndex tile)
|
||||
w->resize.height = w->height - 14 * 4; /* Minimum of 4 vehicles in the display */
|
||||
|
||||
if (tile != 0) {
|
||||
w->caption_color = _map_owner[tile];
|
||||
w->caption_color = GetTileOwner(tile);
|
||||
} else {
|
||||
w->caption_color = _local_player;
|
||||
}
|
||||
@@ -510,7 +510,8 @@ static void DrawRoadDepotWindow(Window *w)
|
||||
tile = w->window_number;
|
||||
|
||||
/* setup disabled buttons */
|
||||
w->disabled_state = (_map_owner[tile]==_local_player) ? 0 : ((1<<4)|(1<<7));
|
||||
w->disabled_state =
|
||||
IsTileOwner(tile, _local_player) ? 0 : ((1 << 4) | (1 << 7));
|
||||
|
||||
/* determine amount of items for scroller */
|
||||
num = 0;
|
||||
@@ -734,7 +735,7 @@ void ShowRoadDepotWindow(uint tile)
|
||||
|
||||
w = AllocateWindowDescFront(&_road_depot_desc, tile);
|
||||
if (w) {
|
||||
w->caption_color = _map_owner[w->window_number];
|
||||
w->caption_color = GetTileOwner(w->window_number);
|
||||
w->hscroll.cap = 5;
|
||||
w->vscroll.cap = 3;
|
||||
w->resize.step_width = 56;
|
||||
|
Reference in New Issue
Block a user