mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-17 01:12:39 +01:00
Codechange: Use EncodedStrings for News messages. (#13654)
This commit is contained in:
@@ -3006,9 +3006,8 @@ static void TrainEnterStation(Train *v, StationID station)
|
||||
Station *st = Station::Get(station);
|
||||
if (!(st->had_vehicle_of_type & HVOT_TRAIN)) {
|
||||
st->had_vehicle_of_type |= HVOT_TRAIN;
|
||||
SetDParam(0, st->index);
|
||||
AddVehicleNewsItem(
|
||||
STR_NEWS_FIRST_TRAIN_ARRIVAL,
|
||||
GetEncodedString(STR_NEWS_FIRST_TRAIN_ARRIVAL, st->index),
|
||||
v->owner == _local_company ? NewsType::ArrivalCompany : NewsType::ArrivalOther,
|
||||
v->index,
|
||||
st->index
|
||||
@@ -3243,8 +3242,7 @@ static bool CheckTrainCollision(Train *v)
|
||||
/* any dead -> no crash */
|
||||
if (tcc.num == 0) return false;
|
||||
|
||||
SetDParam(0, tcc.num);
|
||||
AddTileNewsItem(STR_NEWS_TRAIN_CRASH, NewsType::Accident, v->tile);
|
||||
AddTileNewsItem(GetEncodedString(STR_NEWS_TRAIN_CRASH, tcc.num), NewsType::Accident, v->tile);
|
||||
|
||||
ModifyStationRatingAround(v->tile, v->owner, -160, 30);
|
||||
if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_13_TRAIN_COLLISION, v);
|
||||
@@ -4006,8 +4004,7 @@ static bool TrainLocoHandler(Train *v, bool mode)
|
||||
if (HasBit(v->flags, VRF_TRAIN_STUCK) && v->wait_counter > 2 * _settings_game.pf.wait_for_pbs_path * Ticks::DAY_TICKS) {
|
||||
/* Show message to player. */
|
||||
if (_settings_client.gui.lost_vehicle_warn && v->owner == _local_company) {
|
||||
SetDParam(0, v->index);
|
||||
AddVehicleAdviceNewsItem(AdviceType::TrainStuck, STR_NEWS_TRAIN_IS_STUCK, v->index);
|
||||
AddVehicleAdviceNewsItem(AdviceType::TrainStuck, GetEncodedString(STR_NEWS_TRAIN_IS_STUCK, v->index), v->index);
|
||||
}
|
||||
v->wait_counter = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user