shithub: choc

Download patch

ref: 10408d83e5f53cd8b61a45b42ffb22d983f4975a
parent: 13089753004935ad4b8a4a90886f8c71a7dc4c7b
parent: 00d2024fec6136457981680e0b0422acf0eb1850
author: Fabian Greffrath <fabian@greffrath.com>
date: Mon Nov 25 15:58:46 EST 2019

Merge pull request #1218 from chocolate-doom/partime-map33

doom: correctly determine the par time for MAP33

--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -38,6 +38,7 @@
 #include "i_system.h"
 #include "i_timer.h"
 #include "i_input.h"
+#include "i_swap.h"
 #include "i_video.h"
 
 #include "p_setup.h"
@@ -1460,10 +1461,15 @@
     // statcheck regression testing.
     if (gamemode == commercial)
     {
-        // map33 has no official time: initialize to zero
+        // map33 reads its par time from beyond the cpars[] array
         if (gamemap == 33)
         {
-            wminfo.partime = 0;
+            int cpars32;
+
+            memcpy(&cpars32, DEH_String(GAMMALVL0), sizeof(int));
+            cpars32 = LONG(cpars32);
+
+            wminfo.partime = TICRATE*cpars32;
         }
         else
         {
--- a/src/doom/statdump.c
+++ b/src/doom/statdump.c
@@ -268,7 +268,7 @@
 
 static void PrintStats(FILE *stream, wbstartstruct_t *stats)
 {
-    int leveltime, partime;
+    short leveltime, partime;
     int i;
 
     PrintLevelName(stream, stats->epsd, stats->last);