mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 06:15:04 +00:00
(svn r13123) -Codechange: passing the bankrupt type via data_b is not needed anymore. Patch by Cirdan.
This commit is contained in:
parent
5ea41a57b8
commit
5ede3da220
@ -530,8 +530,7 @@ static void PlayersCheckBankrupt(Player *p)
|
|||||||
SetDParam(0, STR_7056_TRANSPORT_COMPANY_IN_TROUBLE);
|
SetDParam(0, STR_7056_TRANSPORT_COMPANY_IN_TROUBLE);
|
||||||
SetDParam(1, STR_7057_WILL_BE_SOLD_OFF_OR_DECLARED);
|
SetDParam(1, STR_7057_WILL_BE_SOLD_OFF_OR_DECLARED);
|
||||||
SetDParam(2, owner);
|
SetDParam(2, owner);
|
||||||
AddNewsItem(STR_02B6,
|
AddNewsItem(STR_02B6, NS_COMPANY_TROUBLE, 0, owner);
|
||||||
NS_COMPANY_TROUBLE, 0, owner | NB_BTROUBLE);
|
|
||||||
break;
|
break;
|
||||||
case 3: {
|
case 3: {
|
||||||
/* XXX - In multiplayer, should we ask other players if it wants to take
|
/* XXX - In multiplayer, should we ask other players if it wants to take
|
||||||
@ -540,8 +539,7 @@ static void PlayersCheckBankrupt(Player *p)
|
|||||||
SetDParam(0, STR_7056_TRANSPORT_COMPANY_IN_TROUBLE);
|
SetDParam(0, STR_7056_TRANSPORT_COMPANY_IN_TROUBLE);
|
||||||
SetDParam(1, STR_7057_WILL_BE_SOLD_OFF_OR_DECLARED);
|
SetDParam(1, STR_7057_WILL_BE_SOLD_OFF_OR_DECLARED);
|
||||||
SetDParam(2, owner);
|
SetDParam(2, owner);
|
||||||
AddNewsItem(STR_02B6,
|
AddNewsItem(STR_02B6, NS_COMPANY_TROUBLE, 0, owner);
|
||||||
NS_COMPANY_TROUBLE, 0, owner | NB_BTROUBLE);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -564,7 +562,7 @@ static void PlayersCheckBankrupt(Player *p)
|
|||||||
SetDParam(0, STR_705C_BANKRUPT);
|
SetDParam(0, STR_705C_BANKRUPT);
|
||||||
SetDParam(1, STR_705D_HAS_BEEN_CLOSED_DOWN_BY);
|
SetDParam(1, STR_705D_HAS_BEEN_CLOSED_DOWN_BY);
|
||||||
SetDParam(2, p->index);
|
SetDParam(2, p->index);
|
||||||
AddNewsItem(STR_02B6, NS_COMPANY_BANKRUPT, 0, owner | NB_BBANKRUPT);
|
AddNewsItem(STR_02B6, NS_COMPANY_BANKRUPT, 0, owner);
|
||||||
|
|
||||||
if (IsHumanPlayer(owner)) {
|
if (IsHumanPlayer(owner)) {
|
||||||
/* XXX - If we are in offline mode, leave the player playing. Eg. there
|
/* XXX - If we are in offline mode, leave the player playing. Eg. there
|
||||||
@ -592,7 +590,7 @@ static void PlayersCheckBankrupt(Player *p)
|
|||||||
|
|
||||||
void DrawNewsBankrupcy(Window *w, const NewsItem *ni)
|
void DrawNewsBankrupcy(Window *w, const NewsItem *ni)
|
||||||
{
|
{
|
||||||
Player *p = GetPlayer((PlayerID)GB(ni->data_b, 0, 4));
|
Player *p = GetPlayer((PlayerID)(ni->data_b));
|
||||||
DrawPlayerFace(p->face, p->player_color, 2, 23);
|
DrawPlayerFace(p->face, p->player_color, 2, 23);
|
||||||
GfxFillRect(3, 23, 3 + 91, 23 + 118, PALETTE_TO_STRUCT_GREY | (1 << USE_COLORTABLE));
|
GfxFillRect(3, 23, 3 + 91, 23 + 118, PALETTE_TO_STRUCT_GREY | (1 << USE_COLORTABLE));
|
||||||
|
|
||||||
@ -600,8 +598,8 @@ void DrawNewsBankrupcy(Window *w, const NewsItem *ni)
|
|||||||
|
|
||||||
DrawStringMultiCenter(49, 148, STR_7058_PRESIDENT, 94);
|
DrawStringMultiCenter(49, 148, STR_7058_PRESIDENT, 94);
|
||||||
|
|
||||||
switch (ni->data_b & 0xF0) {
|
switch (ni->subtype) {
|
||||||
case NB_BTROUBLE:
|
case NS_COMPANY_TROUBLE:
|
||||||
DrawStringCentered(w->width >> 1, 1, STR_7056_TRANSPORT_COMPANY_IN_TROUBLE, TC_FROMSTRING);
|
DrawStringCentered(w->width >> 1, 1, STR_7056_TRANSPORT_COMPANY_IN_TROUBLE, TC_FROMSTRING);
|
||||||
|
|
||||||
SetDParam(0, p->index);
|
SetDParam(0, p->index);
|
||||||
@ -613,7 +611,7 @@ void DrawNewsBankrupcy(Window *w, const NewsItem *ni)
|
|||||||
w->width - 101);
|
w->width - 101);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NB_BMERGER:
|
case NS_COMPANY_MERGER:
|
||||||
DrawStringCentered(w->width >> 1, 1, STR_7059_TRANSPORT_COMPANY_MERGER, TC_FROMSTRING);
|
DrawStringCentered(w->width >> 1, 1, STR_7059_TRANSPORT_COMPANY_MERGER, TC_FROMSTRING);
|
||||||
SetDParam(0, ni->params[2]);
|
SetDParam(0, ni->params[2]);
|
||||||
SetDParam(1, p->index);
|
SetDParam(1, p->index);
|
||||||
@ -625,7 +623,7 @@ void DrawNewsBankrupcy(Window *w, const NewsItem *ni)
|
|||||||
w->width - 101);
|
w->width - 101);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NB_BBANKRUPT:
|
case NS_COMPANY_BANKRUPT:
|
||||||
DrawStringCentered(w->width >> 1, 1, STR_705C_BANKRUPT, TC_FROMSTRING);
|
DrawStringCentered(w->width >> 1, 1, STR_705C_BANKRUPT, TC_FROMSTRING);
|
||||||
SetDParam(0, p->index);
|
SetDParam(0, p->index);
|
||||||
DrawStringMultiCenter(
|
DrawStringMultiCenter(
|
||||||
@ -635,7 +633,7 @@ void DrawNewsBankrupcy(Window *w, const NewsItem *ni)
|
|||||||
w->width - 101);
|
w->width - 101);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NB_BNEWCOMPANY:
|
case NS_COMPANY_NEW:
|
||||||
DrawStringCentered(w->width >> 1, 1, STR_705E_NEW_TRANSPORT_COMPANY_LAUNCHED, TC_FROMSTRING);
|
DrawStringCentered(w->width >> 1, 1, STR_705E_NEW_TRANSPORT_COMPANY_LAUNCHED, TC_FROMSTRING);
|
||||||
SetDParam(0, p->index);
|
SetDParam(0, p->index);
|
||||||
SetDParam(1, ni->params[3]);
|
SetDParam(1, ni->params[3]);
|
||||||
@ -1820,7 +1818,7 @@ static void DoAcquireCompany(Player *p)
|
|||||||
SetDParam(2, p->index);
|
SetDParam(2, p->index);
|
||||||
SetDParam(3, _current_player);
|
SetDParam(3, _current_player);
|
||||||
SetDParam(4, p->bankrupt_value);
|
SetDParam(4, p->bankrupt_value);
|
||||||
AddNewsItem(STR_02B6, NS_COMPANY_MERGER, 0, _current_player | NB_BMERGER);
|
AddNewsItem(STR_02B6, NS_COMPANY_MERGER, 0, _current_player);
|
||||||
|
|
||||||
/* original code does this a little bit differently */
|
/* original code does this a little bit differently */
|
||||||
PlayerID pi = p->index;
|
PlayerID pi = p->index;
|
||||||
|
@ -90,17 +90,6 @@ enum NewsCallback {
|
|||||||
DNC_NONE = 0xFF, ///< No news callback.
|
DNC_NONE = 0xFF, ///< No news callback.
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Kinds of bankrupcy
|
|
||||||
* @note These flags are or'd with player index
|
|
||||||
*/
|
|
||||||
enum NewsBankrupcy {
|
|
||||||
NB_BTROUBLE = (1 << 4), ///< Company is in trouble (warning)
|
|
||||||
NB_BMERGER = (2 << 4), ///< Company has been bought by another company
|
|
||||||
NB_BBANKRUPT = (3 << 4), ///< Company has gone bankrupt
|
|
||||||
NB_BNEWCOMPANY = (4 << 4), ///< A new company has been started
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* News display options
|
* News display options
|
||||||
*/
|
*/
|
||||||
|
@ -360,7 +360,7 @@ set_name:;
|
|||||||
SetDParam(1, STR_705F_STARTS_CONSTRUCTION_NEAR);
|
SetDParam(1, STR_705F_STARTS_CONSTRUCTION_NEAR);
|
||||||
SetDParam(2, p->index);
|
SetDParam(2, p->index);
|
||||||
SetDParam(3, t->index);
|
SetDParam(3, t->index);
|
||||||
AddNewsItem(STR_02B6, NS_COMPANY_NEW, p->last_build_coordinate, p->index | NB_BNEWCOMPANY);
|
AddNewsItem(STR_02B6, NS_COMPANY_NEW, p->last_build_coordinate, p->index);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -939,7 +939,7 @@ CommandCost CmdPlayerCtrl(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||||||
SetDParam(0, STR_705C_BANKRUPT);
|
SetDParam(0, STR_705C_BANKRUPT);
|
||||||
SetDParam(1, STR_705D_HAS_BEEN_CLOSED_DOWN_BY);
|
SetDParam(1, STR_705D_HAS_BEEN_CLOSED_DOWN_BY);
|
||||||
SetDParam(2, p->index);
|
SetDParam(2, p->index);
|
||||||
AddNewsItem(STR_02B6, NS_COMPANY_BANKRUPT, 0, p->index | NB_BBANKRUPT);
|
AddNewsItem(STR_02B6, NS_COMPANY_BANKRUPT, 0, p->index);
|
||||||
|
|
||||||
/* Remove the company */
|
/* Remove the company */
|
||||||
ChangeOwnershipOfPlayerItems(p->index, PLAYER_SPECTATOR);
|
ChangeOwnershipOfPlayerItems(p->index, PLAYER_SPECTATOR);
|
||||||
|
Loading…
Reference in New Issue
Block a user