summaryrefslogtreecommitdiff
path: root/player_gui.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-05-12 00:11:37 +0000
committerDarkvater <darkvater@openttd.org>2005-05-12 00:11:37 +0000
commit921cc4e94a7703816ff63e4f673eaa9d8a7da4ca (patch)
tree2a2c6834d0b034f560428a4c3abe47e5e2df1f44 /player_gui.c
parentf3b217db9dd377d2e8e5d28434cc01ffe5c23b3b (diff)
downloadopenttd-921cc4e94a7703816ff63e4f673eaa9d8a7da4ca.tar.xz
(svn r2297) - CodeChange: server-check the next batch of commands.
- CodeChange: since only the server will be able to modify difficulty settings, leave the checking of correct values besides, and trust users will join legit servers. - CodeChange: for renaming signs, only check if GetDParam(); eg _decode_parameters is empty ('\0') or not, instead of the extra check of players, etc. That basically does the same thing. Also dirty sign two times when renaming, once before, once after the action. Because if the name becomes shorter and you update only after, garbage remains on the screen. - CodeChange: made GetMaskOfTownActions() available to the town-cmd to double-check if the action was available to the player. For this purpose the hardcoded _local_player has been removed from the function and is now passed as a parameter.
Diffstat (limited to 'player_gui.c')
-rw-r--r--player_gui.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/player_gui.c b/player_gui.c
index e527af1ec..4bf57f553 100644
--- a/player_gui.c
+++ b/player_gui.c
@@ -510,13 +510,16 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e)
if (!_networking) SETBIT(w->hidden_state, 11); // hide company-password widget
} else {
if (_patches.allow_shares) { /* shares are allowed */
+ /* If all shares are owned by someone (none by nobody), disable buy button */
if (GetAmountOwnedBy(p, OWNER_SPECTATOR) == 0) SETBIT(dis, 9);
- /* We cannot buy out real players in a network game */
+ /* Only 25% left to buy. If the player is human, disable buying it up.. TODO issues! */
if (GetAmountOwnedBy(p, OWNER_SPECTATOR) == 1 && !p->is_ai) SETBIT(dis, 9);
+ /* If the player doesn't own any shares, disable sell button */
if (GetAmountOwnedBy(p, _local_player) == 0) SETBIT(dis, 10);
+ /* Spectators cannot do anything of course */
if (_local_player == OWNER_SPECTATOR) dis |= (1 << 9) | (1 << 10);
} else /* shares are not allowed, disable buy/sell buttons */
dis |= (1 << 9) | (1 << 10);