(svn r14169) -Codechange: rename location_of_house for location_of_HQ, which is more exact and less subject to interpretation
--- a/src/ai/default/default.cpp Mon Aug 25 16:07:10 2008 +0000
+++ b/src/ai/default/default.cpp Mon Aug 25 16:10:34 2008 +0000
@@ -3956,7 +3956,7 @@
{
TileIndex tile;
- if (p->location_of_house == 0 &&
+ if (p->location_of_HQ == 0 &&
p->last_build_coordinate != 0) {
tile = AdjustTileCoordRandomly(p->last_build_coordinate, 8);
DoCommand(tile, 0, 0, DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_BUILD_COMPANY_HQ);
--- a/src/ai/trolly/trolly.cpp Mon Aug 25 16:07:10 2008 +0000
+++ b/src/ai/trolly/trolly.cpp Mon Aug 25 16:10:34 2008 +0000
@@ -107,7 +107,7 @@
int c;
assert(_players_ainew[p->index].state == AI_STATE_WAKE_UP);
// First, check if we have a HQ
- if (p->location_of_house == 0) {
+ if (p->location_of_HQ == 0) {
// We have no HQ yet, build one on a random place
// Random till we found a place for it!
// TODO: this should not be on a random place..
--- a/src/oldloader.cpp Mon Aug 25 16:07:10 2008 +0000
+++ b/src/oldloader.cpp Mon Aug 25 16:10:34 2008 +0000
@@ -993,7 +993,7 @@
OCL_SVAR( OC_UINT8, Player, block_preview ),
OCL_VAR( OC_UINT8, 1, &ai_tick ),
OCL_SVAR( OC_UINT8, Player, avail_railtypes ),
- OCL_SVAR( OC_TILE, Player, location_of_house ),
+ OCL_SVAR( OC_TILE, Player, location_of_HQ ),
OCL_SVAR( OC_UINT8, Player, share_owners[0] ),
OCL_SVAR( OC_UINT8, Player, share_owners[1] ),
OCL_SVAR( OC_UINT8, Player, share_owners[2] ),
@@ -1041,8 +1041,8 @@
_player_colors[num] = p->player_color;
p->inaugurated_year -= ORIGINAL_BASE_YEAR;
- if (p->location_of_house == 0xFFFF)
- p->location_of_house = 0;
+ if (p->location_of_HQ == 0xFFFF)
+ p->location_of_HQ = 0;
/* State 20 for AI players is sell vehicle. Since the AI struct is not
* really figured out as of now, _players_ai[p->index].cur_veh; needed for 'sell vehicle'
--- a/src/player_base.h Mon Aug 25 16:07:10 2008 +0000
+++ b/src/player_base.h Mon Aug 25 16:10:34 2008 +0000
@@ -56,7 +56,7 @@
uint32 cargo_types; ///< which cargo types were transported the last year
- TileIndex location_of_house;
+ TileIndex location_of_HQ;
TileIndex last_build_coordinate;
PlayerByte share_owners[4];
--- a/src/player_gui.cpp Mon Aug 25 16:07:10 2008 +0000
+++ b/src/player_gui.cpp Mon Aug 25 16:10:34 2008 +0000
@@ -1185,10 +1185,10 @@
this->SetWidgetHiddenState(PCW_WIDGET_COLOR_SCHEME, !local);
this->SetWidgetHiddenState(PCW_WIDGET_PRESIDENT_NAME, !local);
this->SetWidgetHiddenState(PCW_WIDGET_COMPANY_NAME, !local);
- this->widget[PCW_WIDGET_BUILD_VIEW_HQ].data = (local && p->location_of_house == 0) ? STR_706F_BUILD_HQ : STR_7072_VIEW_HQ;
- if (local && p->location_of_house != 0) this->widget[PCW_WIDGET_BUILD_VIEW_HQ].type = WWT_PUSHTXTBTN; //HQ is already built.
- this->SetWidgetDisabledState(PCW_WIDGET_BUILD_VIEW_HQ, !local && p->location_of_house == 0);
- this->SetWidgetHiddenState(PCW_WIDGET_RELOCATE_HQ, !local || p->location_of_house == 0);
+ this->widget[PCW_WIDGET_BUILD_VIEW_HQ].data = (local && p->location_of_HQ == 0) ? STR_706F_BUILD_HQ : STR_7072_VIEW_HQ;
+ if (local && p->location_of_HQ != 0) this->widget[PCW_WIDGET_BUILD_VIEW_HQ].type = WWT_PUSHTXTBTN; //HQ is already built.
+ this->SetWidgetDisabledState(PCW_WIDGET_BUILD_VIEW_HQ, !local && p->location_of_HQ == 0);
+ this->SetWidgetHiddenState(PCW_WIDGET_RELOCATE_HQ, !local || p->location_of_HQ == 0);
this->SetWidgetHiddenState(PCW_WIDGET_BUY_SHARE, local);
this->SetWidgetHiddenState(PCW_WIDGET_SELL_SHARE, local);
this->SetWidgetHiddenState(PCW_WIDGET_COMPANY_PASSWORD, !local || !_networking);
@@ -1267,7 +1267,7 @@
break;
case PCW_WIDGET_BUILD_VIEW_HQ: {
- TileIndex tile = GetPlayer((PlayerID)this->window_number)->location_of_house;
+ TileIndex tile = GetPlayer((PlayerID)this->window_number)->location_of_HQ;
if (tile == 0) {
if ((byte)this->window_number != _local_player) return;
SetObjectToPlaceWnd(SPR_CURSOR_HQ, PAL_NONE, VHM_RECT, this);
--- a/src/players.cpp Mon Aug 25 16:07:10 2008 +0000
+++ b/src/players.cpp Mon Aug 25 16:10:34 2008 +0000
@@ -1125,8 +1125,8 @@
SLE_CONDVAR(Player, cargo_types, SLE_FILE_U16 | SLE_VAR_U32, 0, 93),
SLE_CONDVAR(Player, cargo_types, SLE_UINT32, 94, SL_MAX_VERSION),
- SLE_CONDVAR(Player, location_of_house, SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
- SLE_CONDVAR(Player, location_of_house, SLE_UINT32, 6, SL_MAX_VERSION),
+ SLE_CONDVAR(Player, location_of_HQ, SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
+ SLE_CONDVAR(Player, location_of_HQ, SLE_UINT32, 6, SL_MAX_VERSION),
SLE_CONDVAR(Player, last_build_coordinate, SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
SLE_CONDVAR(Player, last_build_coordinate, SLE_UINT32, 6, SL_MAX_VERSION),
SLE_CONDVAR(Player, inaugurated_year, SLE_FILE_U8 | SLE_VAR_I32, 0, 30),
--- a/src/unmovable_cmd.cpp Mon Aug 25 16:07:10 2008 +0000
+++ b/src/unmovable_cmd.cpp Mon Aug 25 16:10:34 2008 +0000
@@ -45,13 +45,13 @@
Player *p = GetPlayer(pid);
if (flags & DC_EXEC) {
- TileIndex t = p->location_of_house;
+ TileIndex t = p->location_of_HQ;
DoClearSquare(t + TileDiffXY(0, 0));
DoClearSquare(t + TileDiffXY(0, 1));
DoClearSquare(t + TileDiffXY(1, 0));
DoClearSquare(t + TileDiffXY(1, 1));
- p->location_of_house = 0; // reset HQ position
+ p->location_of_HQ = 0; // reset HQ position
InvalidateWindow(WC_COMPANY, pid);
}
@@ -62,7 +62,7 @@
void UpdateCompanyHQ(Player *p, uint score)
{
byte val;
- TileIndex tile = p->location_of_house;
+ TileIndex tile = p->location_of_HQ;
if (tile == 0) return;
@@ -96,14 +96,14 @@
cost = CheckFlatLandBelow(tile, 2, 2, flags, 0, NULL);
if (CmdFailed(cost)) return cost;
- if (p->location_of_house != 0) { // Moving HQ
+ if (p->location_of_HQ != 0) { // Moving HQ
cost.AddCost(DestroyCompanyHQ(_current_player, flags));
}
if (flags & DC_EXEC) {
int score = UpdateCompanyRatingAndValue(p, false);
- p->location_of_house = tile;
+ p->location_of_HQ = tile;
MakeCompanyHQ(tile, _current_player);