diff options
author | darkvater <darkvater@openttd.org> | 2005-01-07 23:59:59 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2005-01-07 23:59:59 +0000 |
commit | 116789022c70f8f34c839ef85db8701472b3d634 (patch) | |
tree | c343b9a28596934c1b2104f657c6c1fe13651e5b /player_gui.c | |
parent | b78b576b214512a66dde9b59eea141824d162690 (diff) | |
download | openttd-116789022c70f8f34c839ef85db8701472b3d634.tar.xz |
(svn r1418) -Feature: [1098254] (dis)Allow Shares. Add patch options to allow buying/selling of shares (Hackykid)
Diffstat (limited to 'player_gui.c')
-rw-r--r-- | player_gui.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/player_gui.c b/player_gui.c index 74cb7c817..3cd0380ef 100644 --- a/player_gui.c +++ b/player_gui.c @@ -506,14 +506,19 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) if (!IsWindowOfPrototype(w, _other_player_company_widgets)) { AssignWidgetToWindow(w, (p->location_of_house != 0) ? _my_player_company_bh_widgets : _my_player_company_widgets); - if (!_networking) w->hidden_state |= (1 << 11); // hide company-password widget + if (!_networking) SETBIT(w->hidden_state, 11); // hide company-password widget } else { - if (GetAmountOwnedBy(p, OWNER_SPECTATOR) == 0) dis |= 1 << 9; - // Also disable the buy button if 25% is not-owned by someone - // and the player is not an AI - if (GetAmountOwnedBy(p, OWNER_SPECTATOR) == 1 && !p->is_ai) dis |= 1 << 9; - if (GetAmountOwnedBy(p, _local_player) == 0) dis |= 1 << 10; - if (_local_player == OWNER_SPECTATOR) dis |= (1 << 9) | (1 << 10); + if (_patches.allow_shares) { /* shares are allowed */ + if (GetAmountOwnedBy(p, OWNER_SPECTATOR) == 0) SETBIT(dis, 9); + + /* We cannot buy out real players in a network game */ + if (GetAmountOwnedBy(p, OWNER_SPECTATOR) == 1 && !p->is_ai) SETBIT(dis, 9); + + if (GetAmountOwnedBy(p, _local_player) == 0) SETBIT(dis, 10); + + if (_local_player == OWNER_SPECTATOR) dis |= (1 << 9) | (1 << 10); + } else /* shares are not allowed, disable buy/sell buttons */ + dis |= (1 << 9) | (1 << 10); } SetDParam(0, p->name_1); |