(svn r6774) -Codechange: Rename the badly named OWNER_SPECTATOR to PLAYER_SPECTATOR and

put it into player.h where it belongs (instead of map.h)
This commit is contained in:
Darkvater
2006-10-14 15:49:43 +00:00
parent abb0fa7bc5
commit dad5d5dd72
30 changed files with 86 additions and 82 deletions

View File

@@ -693,16 +693,16 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e)
if (!local) {
if (_patches.allow_shares) { // Shares are allowed
/* If all shares are owned by someone (none by nobody), disable buy button */
SetWindowWidgetDisabledState(w, PCW_WIDGET_BUY_SHARE, GetAmountOwnedBy(p, OWNER_SPECTATOR) == 0 ||
SetWindowWidgetDisabledState(w, PCW_WIDGET_BUY_SHARE, GetAmountOwnedBy(p, PLAYER_SPECTATOR) == 0 ||
/* Only 25% left to buy. If the player is human, disable buying it up.. TODO issues! */
(GetAmountOwnedBy(p, OWNER_SPECTATOR) == 1 && !p->is_ai) ||
(GetAmountOwnedBy(p, PLAYER_SPECTATOR) == 1 && !p->is_ai) ||
/* Spectators cannot do anything of course */
_local_player == OWNER_SPECTATOR);
_local_player == PLAYER_SPECTATOR);
/* If the player doesn't own any shares, disable sell button */
SetWindowWidgetDisabledState(w, PCW_WIDGET_SELL_SHARE, (GetAmountOwnedBy(p, _local_player) == 0) ||
/* Spectators cannot do anything of course */
_local_player == OWNER_SPECTATOR);
_local_player == PLAYER_SPECTATOR);
} else { // Shares are not allowed, disable buy/sell buttons
DisableWindowWidget(w, PCW_WIDGET_BUY_SHARE);
DisableWindowWidget(w, PCW_WIDGET_SELL_SHARE);
@@ -1105,7 +1105,7 @@ void ShowEndGameChart(void)
WP(w, highscore_d).background_img = SPR_TYCOON_IMG1_BEGIN;
if (_local_player != OWNER_SPECTATOR) {
if (_local_player != PLAYER_SPECTATOR) {
const Player *p = GetPlayer(_local_player);
if (p->old_economy[0].performance_history == SCORE_MAX)
WP(w, highscore_d).background_img = SPR_TYCOON_IMG2_BEGIN;