Changeset - r16569:e4bef51ab6b8
[Not reviewed]
master
0 2 0
glx - 14 years ago 2010-11-24 01:08:49
glx@openttd.org
(svn r21309) -Fix: second parameter of SetupSubsidyDecodeParam() is a bool, so use a bool when calling the function
2 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/subsidy.cpp
Show inline comments
 
@@ -42,13 +42,13 @@ void Subsidy::AwardTo(CompanyID company)
 

	
 
	char *company_name = MallocT<char>(MAX_LENGTH_COMPANY_NAME_BYTES);
 
	SetDParam(0, company);
 
	GetString(company_name, STR_COMPANY_NAME, company_name + MAX_LENGTH_COMPANY_NAME_BYTES - 1);
 

	
 
	/* Add a news item */
 
	Pair reftype = SetupSubsidyDecodeParam(this, 0);
 
	Pair reftype = SetupSubsidyDecodeParam(this, false);
 
	InjectDParam(1);
 

	
 
	SetDParamStr(0, company_name);
 
	AddNewsItem(
 
		STR_NEWS_SERVICE_SUBSIDY_AWARDED_HALF + _settings_game.difficulty.subsidy_multiplier,
 
		NS_SUBSIDIES,
 
@@ -275,18 +275,18 @@ void SubsidyMonthlyLoop()
 
	bool modified = false;
 

	
 
	Subsidy *s;
 
	FOR_ALL_SUBSIDIES(s) {
 
		if (--s->remaining == 0) {
 
			if (!s->IsAwarded()) {
 
				Pair reftype = SetupSubsidyDecodeParam(s, 1);
 
				Pair reftype = SetupSubsidyDecodeParam(s, true);
 
				AddNewsItem(STR_NEWS_OFFER_OF_SUBSIDY_EXPIRED, NS_SUBSIDIES, (NewsReferenceType)reftype.a, s->src, (NewsReferenceType)reftype.b, s->dst);
 
				AI::BroadcastNewEvent(new AIEventSubsidyOfferExpired(s->index));
 
			} else {
 
				if (s->awarded == _local_company) {
 
					Pair reftype = SetupSubsidyDecodeParam(s, 1);
 
					Pair reftype = SetupSubsidyDecodeParam(s, true);
 
					AddNewsItem(STR_NEWS_SUBSIDY_WITHDRAWN_SERVICE, NS_SUBSIDIES, (NewsReferenceType)reftype.a, s->src, (NewsReferenceType)reftype.b, s->dst);
 
				}
 
				AI::BroadcastNewEvent(new AIEventSubsidyExpired(s->index));
 
			}
 
			delete s;
 
			modified = true;
 
@@ -301,13 +301,13 @@ void SubsidyMonthlyLoop()
 
		do {
 
			Subsidy *s = FindSubsidyPassengerRoute();
 
			if (s == NULL) s = FindSubsidyCargoRoute();
 
			if (s != NULL) {
 
				s->remaining = SUBSIDY_OFFER_MONTHS;
 
				s->awarded = INVALID_COMPANY;
 
				Pair reftype = SetupSubsidyDecodeParam(s, 0);
 
				Pair reftype = SetupSubsidyDecodeParam(s, false);
 
				AddNewsItem(STR_NEWS_SERVICE_SUBSIDY_OFFERED, NS_SUBSIDIES, (NewsReferenceType)reftype.a, s->src, (NewsReferenceType)reftype.b, s->dst);
 
				SetPartOfSubsidyFlag(s->src_type, s->src, POS_SRC);
 
				SetPartOfSubsidyFlag(s->dst_type, s->dst, POS_DST);
 
				AI::BroadcastNewEvent(new AIEventSubsidyOffer(s->index));
 
				modified = true;
 
				break;
src/subsidy_gui.cpp
Show inline comments
 
@@ -171,13 +171,13 @@ struct SubsidyListWindow : Window {
 
		uint num = 0;
 
		const Subsidy *s;
 
		FOR_ALL_SUBSIDIES(s) {
 
			if (!s->IsAwarded()) {
 
				if (IsInsideMM(pos, 0, cap)) {
 
					/* Displays the two offered towns */
 
					SetupSubsidyDecodeParam(s, 1);
 
					SetupSubsidyDecodeParam(s, true);
 
					SetDParam(7, _date - ymd.day + s->remaining * 32);
 
					DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_OFFERED_FROM_TO);
 
				}
 
				pos++;
 
				num++;
 
			}
 
@@ -194,13 +194,13 @@ struct SubsidyListWindow : Window {
 
		pos++;
 
		num = 0;
 

	
 
		FOR_ALL_SUBSIDIES(s) {
 
			if (s->IsAwarded()) {
 
				if (IsInsideMM(pos, 0, cap)) {
 
					SetupSubsidyDecodeParam(s, 1);
 
					SetupSubsidyDecodeParam(s, true);
 
					SetDParam(7, s->awarded);
 
					SetDParam(8, _date - ymd.day + s->remaining * 32);
 

	
 
					/* Displays the two connected stations */
 
					DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_SUBSIDISED_FROM_TO);
 
				}
0 comments (0 inline, 0 general)