From 0a1758f44f71fb3608a08ba97eee03876c5e2508 Mon Sep 17 00:00:00 2001 From: Kp Date: Mon, 22 Aug 2022 01:24:49 +0000 Subject: [PATCH] Ignore excess hostages during scoring Descent 2 secret levels allow a player to rescue hostages that are not counted in `total_hostages`, so a player can exit with more hostages saved than were in the mine. Change the scoring logic not to penalize a player for saving these unaccounted hostages. --- similar/main/gameseq.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/similar/main/gameseq.cpp b/similar/main/gameseq.cpp index 0b068d700..545ab92b6 100644 --- a/similar/main/gameseq.cpp +++ b/similar/main/gameseq.cpp @@ -1276,8 +1276,11 @@ static void DoEndLevelScoreGlitz() auto &hostage_text = m_str[c++]; if (cheats.enabled) snprintf(hostage_text, sizeof(hostage_text), "Hostages saved: \t%u", hostages_on_board); - else if (const auto hostages_lost = LevelUniqueObjectState.total_hostages - hostages_on_board) + else if (LevelUniqueObjectState.total_hostages > hostages_on_board) + { + const auto hostages_lost = LevelUniqueObjectState.total_hostages - hostages_on_board; snprintf(hostage_text, sizeof(hostage_text), "Hostages lost: \t%u", hostages_lost); + } else { all_hostage_points = hostages_on_board * 1000 * (underlying_value(Difficulty_level) + 1);