foxygit / doom Log in
commit 86c6148b2141c3d0d08137dd377f80087321cc98
Author:     Acts 19 quiz <63941237+Acts19quiz@users.noreply.github.com>
AuthorDate: Thu Mar 18 16:03:32 2021 -0500
Commit:     GitHub <noreply@github.com>
CommitDate: Thu Mar 18 22:03:32 2021 +0100

    Add chex.exe par times for chex.wad. (#1356)

    * Add chex.exe par times for chex.wad.

    * Merge Chex array into Doom 1's to fix #1355

    * Remove map count check.

    * Reinstate Chex array with checks to truncate it to fix #1355

    * Rename qpars to chexpars fix #1355

    * Add gameepisode check to Chex par time calculation #1355

    * Trim fat, remove first {0} sub-array. #1355

    * Remove brackets on chexpars to match cpars. #1355

    Co-authored-by: Acts 19 quiz <N/A>
---
 src/doom/g_game.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/doom/g_game.c b/src/doom/g_game.c
index d3b2f3e4..ff4c3763 100644
--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -1319,6 +1319,12 @@ int cpars[32] =
     240,150,180,150,150,300,330,420,300,180,	// 21-30
     120,30					// 31-32
 };
+
+// Chex Quest Par Times
+int chexpars[6] =
+{
+    0,120,360,480,200,360
+};


 //
@@ -1480,7 +1486,14 @@ void G_DoCompleted (void)
     // overflows into the cpars array.
     else if (gameepisode < 4)
     {
-        wminfo.partime = TICRATE*pars[gameepisode][gamemap];
+        if (gameversion == exe_chex && gameepisode == 1 && gamemap < 6)
+        {
+            wminfo.partime = TICRATE*chexpars[gamemap];
+        }
+        else
+        {
+            wminfo.partime = TICRATE*pars[gameepisode][gamemap];
+        }
     }
     else
     {