1
0
Fork 0

(svn r10921) -Fix [FS#1130] (r10323): the company related news messages still thought that companies were described by two parameters instead of one.

release/0.6
rubidium 2007-08-16 10:10:59 +00:00
parent 1b329b1bd9
commit ada36e7122
1 changed files with 20 additions and 28 deletions

View File

@ -509,11 +509,10 @@ static void PlayersCheckBankrupt(Player *p)
void DrawNewsBankrupcy(Window *w) void DrawNewsBankrupcy(Window *w)
{ {
Player *p;
DrawNewsBorder(w); DrawNewsBorder(w);
p = GetPlayer((PlayerID)GB(WP(w,news_d).ni->string_id, 0, 4)); const NewsItem *ni = WP(w, news_d).ni;
Player *p = GetPlayer((PlayerID)GB(ni->string_id, 0, 4));
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));
@ -521,9 +520,9 @@ void DrawNewsBankrupcy(Window *w)
DrawStringMultiCenter(49, 148, STR_7058_PRESIDENT, 94); DrawStringMultiCenter(49, 148, STR_7058_PRESIDENT, 94);
switch (WP(w,news_d).ni->string_id & 0xF0) { switch (ni->string_id & 0xF0) {
case NB_BTROUBLE: case NB_BTROUBLE:
DrawStringCentered(w->width>>1, 1, STR_7056_TRANSPORT_COMPANY_IN_TROUBLE, 0); DrawStringCentered(w->width >> 1, 1, STR_7056_TRANSPORT_COMPANY_IN_TROUBLE, 0);
SetDParam(0, p->index); SetDParam(0, p->index);
@ -534,25 +533,21 @@ void DrawNewsBankrupcy(Window *w)
w->width - 101); w->width - 101);
break; break;
case NB_BMERGER: { case NB_BMERGER:
int32 price; DrawStringCentered(w->width >> 1, 1, STR_7059_TRANSPORT_COMPANY_MERGER, 0);
SetDParam(0, ni->params[0]);
DrawStringCentered(w->width>>1, 1, STR_7059_TRANSPORT_COMPANY_MERGER, 0); SetDParam(1, p->index);
CopyInDParam(0,WP(w,news_d).ni->params, 2); SetDParam(2, ni->params[1]);
SetDParam(2, p->index);
price = WP(w,news_d).ni->params[2];
SetDParam(3, price);
DrawStringMultiCenter( DrawStringMultiCenter(
((w->width - 101) >> 1) + 98, ((w->width - 101) >> 1) + 98,
90, 90,
price==0 ? STR_707F_HAS_BEEN_TAKEN_OVER_BY : STR_705A_HAS_BEEN_SOLD_TO_FOR, ni->params[1] == 0 ? STR_707F_HAS_BEEN_TAKEN_OVER_BY : STR_705A_HAS_BEEN_SOLD_TO_FOR,
w->width - 101); w->width - 101);
break; break;
}
case NB_BBANKRUPT: case NB_BBANKRUPT:
DrawStringCentered(w->width>>1, 1, STR_705C_BANKRUPT, 0); DrawStringCentered(w->width >> 1, 1, STR_705C_BANKRUPT, 0);
CopyInDParam(0,WP(w,news_d).ni->params, 2); SetDParam(0, ni->params[0]);
DrawStringMultiCenter( DrawStringMultiCenter(
((w->width - 101) >> 1) + 98, ((w->width - 101) >> 1) + 98,
90, 90,
@ -561,9 +556,9 @@ void DrawNewsBankrupcy(Window *w)
break; break;
case NB_BNEWCOMPANY: case NB_BNEWCOMPANY:
DrawStringCentered(w->width>>1, 1, STR_705E_NEW_TRANSPORT_COMPANY_LAUNCHED, 0); DrawStringCentered(w->width >> 1, 1, STR_705E_NEW_TRANSPORT_COMPANY_LAUNCHED, 0);
SetDParam(0, p->index); SetDParam(0, p->index);
CopyInDParam(1,WP(w,news_d).ni->params, 2); SetDParam(1, ni->params[0]);
DrawStringMultiCenter( DrawStringMultiCenter(
((w->width - 101) >> 1) + 98, ((w->width - 101) >> 1) + 98,
90, 90,
@ -588,28 +583,25 @@ StringID GetNewsStringBankrupcy(const NewsItem *ni)
return STR_02B6; return STR_02B6;
case NB_BMERGER: case NB_BMERGER:
SetDParam(0, STR_7059_TRANSPORT_COMPANY_MERGER); SetDParam(0, STR_7059_TRANSPORT_COMPANY_MERGER);
SetDParam(1, STR_705A_HAS_BEEN_SOLD_TO_FOR); SetDParam(1, ni->params[1] == 0 ? STR_707F_HAS_BEEN_TAKEN_OVER_BY : STR_705A_HAS_BEEN_SOLD_TO_FOR);
CopyInDParam(2,ni->params, 2); SetDParam(2, ni->params[0]);
SetDParam(4, p->index); SetDParam(3, p->index);
CopyInDParam(5,ni->params + 2, 1); SetDParam(4, ni->params[1]);
return STR_02B6; return STR_02B6;
case NB_BBANKRUPT: case NB_BBANKRUPT:
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);
CopyInDParam(2,ni->params, 2); SetDParam(2, ni->params[0]);
return STR_02B6; return STR_02B6;
case NB_BNEWCOMPANY: case NB_BNEWCOMPANY:
SetDParam(0, STR_705E_NEW_TRANSPORT_COMPANY_LAUNCHED); SetDParam(0, STR_705E_NEW_TRANSPORT_COMPANY_LAUNCHED);
SetDParam(1, STR_705F_STARTS_CONSTRUCTION_NEAR); SetDParam(1, STR_705F_STARTS_CONSTRUCTION_NEAR);
SetDParam(2, p->index); SetDParam(2, p->index);
CopyInDParam(3,ni->params, 2); SetDParam(3, ni->params[0]);
return STR_02B6; return STR_02B6;
default: default:
NOT_REACHED(); NOT_REACHED();
} }
/* useless, but avoids compiler warning this way */
return 0;
} }
static void PlayersGenStatistics() static void PlayersGenStatistics()