]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix own checkpoint improvements not being displayed while there is a better time...
authorDr. Jaska <drjaska83@gmail.com>
Mon, 27 May 2024 09:19:46 +0000 (09:19 +0000)
committerDr. Jaska <drjaska83@gmail.com>
Mon, 27 May 2024 09:19:46 +0000 (09:19 +0000)
qcsrc/server/race.qc

index 739eef06f0ef80ebf0540cecca52e2f764fb272f..7f37db341cb78479fcbea450060eb97638f1d140 100644 (file)
@@ -519,7 +519,6 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
                if(tvalid)
                {
                        recordtime = race_checkpoint_records[cp];
-                       float myrecordtime = e.race_checkpoint_record[cp];
                        recordholder = strcat(race_checkpoint_recordholders[cp]); // make a tempstring copy, as we'll possibly strunzone it!
                        if(recordholder == e.netname)
                                recordholder = "";
@@ -531,8 +530,6 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
                                        race_setTime(GetMapname(), t, e.crypto_idfp, e.netname, e, true);
                                        MUTATOR_CALLHOOK(Race_FinalCheckpoint, e);
                                }
-                               if(t < myrecordtime || myrecordtime == 0)
-                                       e.race_checkpoint_record[cp] = t; // resending done below
 
                                if(t < recordtime || recordtime == 0)
                                {
@@ -572,6 +569,14 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
                                });
                        }
                }
+               // check if new pb should be set for a checkpoint
+               if(tvalid)
+               {
+                       float myrecordtime = e.race_checkpoint_record[cp];
+                       if(t != 0)
+                               if(t < myrecordtime || myrecordtime == 0)
+                                       e.race_checkpoint_record[cp] = t;
+               }
        }
        else // RACE! Not Qualifying
        {