From 116789022c70f8f34c839ef85db8701472b3d634 Mon Sep 17 00:00:00 2001 From: darkvater Date: Fri, 7 Jan 2005 23:59:59 +0000 Subject: (svn r1418) -Feature: [1098254] (dis)Allow Shares. Add patch options to allow buying/selling of shares (Hackykid) --- player_gui.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'player_gui.c') 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); -- cgit v1.2.3-54-g00ecf