From 163119ea3be94ded7be1706b7b4353f6dd2dc78d Mon Sep 17 00:00:00 2001 From: Michael Stowe <33729757+mkstowe@users.noreply.github.com> Date: Thu, 16 Apr 2020 20:04:12 -0400 Subject: [PATCH] Fix #11275: Crashes that kill only 1 peep create grammatically incorrect messages (#11278) Fix #11275: Crashes that kill only 1 peep create grammatically incorrect messages (#11278) Co-authored-by: Tulio Leao --- data/language/en-GB.txt | 1 + src/openrct2/localisation/StringIds.h | 2 ++ src/openrct2/ride/Vehicle.cpp | 3 +++ 3 files changed, 6 insertions(+) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index de389a965d..81cec1d973 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3677,6 +3677,7 @@ STR_6360 :{SMALLFONT}{BLACK}{COMMA32} STR_6361 :Enable lighting effects on rides (experimental) STR_6362 :{SMALLFONT}{BLACK}If enabled, vehicles for tracked rides will be lit up at night. STR_6363 :Copied text to clipboard +STR_6364 :{RED}{COMMA16} person has died in an accident on {STRINGID} STR_6464 :Ride casualties STR_6465 :Stuck or stalled vehicles diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 863167dfa6..67c2dd2b02 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -3911,6 +3911,8 @@ enum STR_COPY_INPUT_TO_CLIPBOARD = 6363, + STR_X_PERSON_DIED_ON_X = 6364, + STR_NOTIFICATION_RIDE_CASUALTIES = 6464, STR_NOTIFICATION_RIDE_VEHICLE_STALLED = 6465, diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 7d2853d91a..e9c376b859 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -5209,6 +5209,9 @@ static void vehicle_kill_all_passengers(Vehicle* vehicle) if (numFatalities != 0) { + ride->FormatNameTo(gCommonFormatArgs + 2); + news_item_add_to_queue( + NEWS_ITEM_RIDE, numFatalities == 1 ? STR_X_PERSON_DIED_ON_X : STR_X_PEOPLE_DIED_ON_X, vehicle->ride); if (gConfigNotifications.ride_casualties) { ride->FormatNameTo(gCommonFormatArgs + 2);