Mercurial > hg > openttd
comparison src/train_cmd.cpp @ 9234:02827bf3dc03 draft
(svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Thu, 15 May 2008 13:39:36 +0000 |
parents | c8a0fa0e208a |
children | 85a62fb8608f |
comparison
equal
deleted
inserted
replaced
9233:624106a1977d | 9234:02827bf3dc03 |
---|---|
2448 /* and notify user about the event */ | 2448 /* and notify user about the event */ |
2449 if (_patches.lost_train_warn && v->owner == _local_player) { | 2449 if (_patches.lost_train_warn && v->owner == _local_player) { |
2450 SetDParam(0, v->unitnumber); | 2450 SetDParam(0, v->unitnumber); |
2451 AddNewsItem( | 2451 AddNewsItem( |
2452 STR_TRAIN_IS_LOST, | 2452 STR_TRAIN_IS_LOST, |
2453 NM_SMALL, NF_VIEWPORT | NF_VEHICLE, NT_ADVICE, DNC_NONE, | 2453 NS_ADVICE, |
2454 v->index, | 2454 v->index, |
2455 0); | 2455 0); |
2456 } | 2456 } |
2457 } | 2457 } |
2458 } else { | 2458 } else { |
2645 if (!(st->had_vehicle_of_type & HVOT_TRAIN)) { | 2645 if (!(st->had_vehicle_of_type & HVOT_TRAIN)) { |
2646 st->had_vehicle_of_type |= HVOT_TRAIN; | 2646 st->had_vehicle_of_type |= HVOT_TRAIN; |
2647 SetDParam(0, st->index); | 2647 SetDParam(0, st->index); |
2648 AddNewsItem( | 2648 AddNewsItem( |
2649 STR_8801_CITIZENS_CELEBRATE_FIRST, | 2649 STR_8801_CITIZENS_CELEBRATE_FIRST, |
2650 NM_THIN, NF_VIEWPORT | NF_VEHICLE, v->owner == _local_player ? NT_ARRIVAL_PLAYER : NT_ARRIVAL_OTHER, DNC_NONE, | 2650 v->owner == _local_player ? NS_ARRIVAL_PLAYER : NS_ARRIVAL_OTHER, |
2651 v->index, | 2651 v->index, |
2652 0 | 2652 0 |
2653 ); | 2653 ); |
2654 } | 2654 } |
2655 | 2655 |
2891 /* any dead -> no crash */ | 2891 /* any dead -> no crash */ |
2892 if (tcc.num == 0) return; | 2892 if (tcc.num == 0) return; |
2893 | 2893 |
2894 SetDParam(0, tcc.num); | 2894 SetDParam(0, tcc.num); |
2895 AddNewsItem(STR_8868_TRAIN_CRASH_DIE_IN_FIREBALL, | 2895 AddNewsItem(STR_8868_TRAIN_CRASH_DIE_IN_FIREBALL, |
2896 NM_THIN, NF_VIEWPORT | NF_VEHICLE, NT_ACCIDENT, DNC_NONE, | 2896 NS_ACCIDENT_VEHICLE, |
2897 v->index, | 2897 v->index, |
2898 0 | 2898 0 |
2899 ); | 2899 ); |
2900 | 2900 |
2901 ModifyStationRatingAround(v->tile, v->owner, -160, 30); | 2901 ModifyStationRatingAround(v->tile, v->owner, -160, 30); |
3615 if (_patches.train_income_warn && v->owner == _local_player && v->age >= 730 && v->GetDisplayProfitThisYear() < 0) { | 3615 if (_patches.train_income_warn && v->owner == _local_player && v->age >= 730 && v->GetDisplayProfitThisYear() < 0) { |
3616 SetDParam(1, v->GetDisplayProfitThisYear()); | 3616 SetDParam(1, v->GetDisplayProfitThisYear()); |
3617 SetDParam(0, v->unitnumber); | 3617 SetDParam(0, v->unitnumber); |
3618 AddNewsItem( | 3618 AddNewsItem( |
3619 STR_TRAIN_IS_UNPROFITABLE, | 3619 STR_TRAIN_IS_UNPROFITABLE, |
3620 NM_SMALL, NF_VIEWPORT | NF_VEHICLE, NT_ADVICE, DNC_NONE, | 3620 NS_ADVICE, |
3621 v->index, | 3621 v->index, |
3622 0); | 3622 0); |
3623 } | 3623 } |
3624 | 3624 |
3625 v->profit_last_year = v->profit_this_year; | 3625 v->profit_last_year = v->profit_this_year; |