diff options
author | celestar <celestar@openttd.org> | 2006-03-31 08:59:19 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2006-03-31 08:59:19 +0000 |
commit | 3f7eb666ba71af02cd94e862e1182f445e9025de (patch) | |
tree | 3727f85f2767737fb8f5414b2ed6b0fe2ee22a24 /economy.c | |
parent | c4a4bb2ffbb71a044f9200e47c242b2efc5bbca2 (diff) | |
download | openttd-3f7eb666ba71af02cd94e862e1182f445e9025de.tar.xz |
(svn r4194) -Codechange: Renamed UpdatePlayerHouse to UpdateCompanyHQ because the rest of the code calls it Comapany HQ. Moved it to unmovable_cmd.c because CompanyHQ is an unmovable and has nothing to do with economy.
Diffstat (limited to 'economy.c')
-rw-r--r-- | economy.c | 32 |
1 files changed, 2 insertions, 30 deletions
@@ -28,6 +28,7 @@ #include "ai/ai.h" #include "train.h" #include "newgrf_engine.h" +#include "unmovable.h" // Score info const ScoreInfo _score_info[] = { @@ -45,35 +46,6 @@ const ScoreInfo _score_info[] = { int _score_part[MAX_PLAYERS][NUM_SCORE]; -void UpdatePlayerHouse(Player *p, uint score) -{ - byte val; - TileIndex tile = p->location_of_house; - - if (tile == 0) - return; - - (val = 128, score < 170) || - (val+= 4, score < 350) || - (val+= 4, score < 520) || - (val+= 4, score < 720) || - (val+= 4, true); - -/* house is already big enough */ - if (val <= _m[tile].m5) - return; - - _m[tile + TileDiffXY(0, 0)].m5 = val; - _m[tile + TileDiffXY(0, 1)].m5 = ++val; - _m[tile + TileDiffXY(1, 0)].m5 = ++val; - _m[tile + TileDiffXY(1, 1)].m5 = ++val; - - MarkTileDirtyByTile(tile + TileDiffXY(0, 0)); - MarkTileDirtyByTile(tile + TileDiffXY(0, 1)); - MarkTileDirtyByTile(tile + TileDiffXY(1, 0)); - MarkTileDirtyByTile(tile + TileDiffXY(1, 1)); -} - int64 CalculateCompanyValue(const Player* p) { PlayerID owner = p->index; @@ -258,7 +230,7 @@ int UpdateCompanyRatingAndValue(Player *p, bool update) if (update) { p->old_economy[0].performance_history = score; - UpdatePlayerHouse(p, score); + UpdateCompanyHQ(p, score); p->old_economy[0].company_value = CalculateCompanyValue(p); } |