summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-08-25 16:10:34 +0000
committerbelugas <belugas@openttd.org>2008-08-25 16:10:34 +0000
commit08898f69bebd4ed5fc866aeb31406cc512ed7fcf (patch)
tree939b2bf0ef664550aa207ba7a014be3c9614adb9 /src
parentcf52b683c0a478b113bd25893f49554906edb32f (diff)
downloadopenttd-08898f69bebd4ed5fc866aeb31406cc512ed7fcf.tar.xz
(svn r14169) -Codechange: rename location_of_house for location_of_HQ, which is more exact and less subject to interpretation
Diffstat (limited to 'src')
-rw-r--r--src/ai/default/default.cpp2
-rw-r--r--src/ai/trolly/trolly.cpp2
-rw-r--r--src/oldloader.cpp6
-rw-r--r--src/player_base.h2
-rw-r--r--src/player_gui.cpp10
-rw-r--r--src/players.cpp4
-rw-r--r--src/unmovable_cmd.cpp10
7 files changed, 18 insertions, 18 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index 650250ca5..105f43b52 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -3956,7 +3956,7 @@ static void AiBuildCompanyHQ(Player *p)
{
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);
diff --git a/src/ai/trolly/trolly.cpp b/src/ai/trolly/trolly.cpp
index 708753b8b..bbd630673 100644
--- a/src/ai/trolly/trolly.cpp
+++ b/src/ai/trolly/trolly.cpp
@@ -107,7 +107,7 @@ static void AiNew_State_WakeUp(Player *p)
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..
diff --git a/src/oldloader.cpp b/src/oldloader.cpp
index 5af1de8c2..f7a0834c6 100644
--- a/src/oldloader.cpp
+++ b/src/oldloader.cpp
@@ -993,7 +993,7 @@ static const OldChunks player_chunk[] = {
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 @@ static bool LoadOldPlayer(LoadgameState *ls, int num)
_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'
diff --git a/src/player_base.h b/src/player_base.h
index 3ede33f15..e699773a4 100644
--- a/src/player_base.h
+++ b/src/player_base.h
@@ -56,7 +56,7 @@ struct Player : PoolItem<Player, PlayerByte, &_Player_pool> {
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];
diff --git a/src/player_gui.cpp b/src/player_gui.cpp
index 006e7244d..8b1c24ab3 100644
--- a/src/player_gui.cpp
+++ b/src/player_gui.cpp
@@ -1185,10 +1185,10 @@ struct PlayerCompanyWindow : Window
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 @@ struct PlayerCompanyWindow : Window
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);
diff --git a/src/players.cpp b/src/players.cpp
index 2dafa90a2..0b725b24c 100644
--- a/src/players.cpp
+++ b/src/players.cpp
@@ -1125,8 +1125,8 @@ static const SaveLoad _player_desc[] = {
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),
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index 38098399c..9e8a8ad93 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -45,13 +45,13 @@ static CommandCost DestroyCompanyHQ(PlayerID pid, uint32 flags)
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 @@ static CommandCost DestroyCompanyHQ(PlayerID pid, uint32 flags)
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 @@ CommandCost CmdBuildCompanyHQ(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
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);