]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/race.qc
Merge branch 'master' into Mario/showspecs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / race.qc
index 3d4bb782f3dfbb024559a246285fde9f26e18901..f729137a61542fd61a8861dfccc49e9a5d0282b9 100644 (file)
@@ -22,7 +22,7 @@ void race_InitSpectator()
                        race_SendNextCheckpoint(msg_entity.enemy, 1);
 }
 
-void W_Porto_Fail(float failhard);
+void W_Porto_Fail(entity this, float failhard);
 
 float race_readTime(string map, float pos)
 {
@@ -457,17 +457,17 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
        }
        else // RACE! Not Qualifying
        {
-               float lself, lother, othtime;
+               float mylaps, lother, othtime;
                entity oth;
                oth = race_checkpoint_lastplayers[cp];
                if(oth)
                {
-                       lself = PlayerScore_Add(e, SP_RACE_LAPS, 0);
+                       mylaps = PlayerScore_Add(e, SP_RACE_LAPS, 0);
                        lother = race_checkpoint_lastlaps[cp];
                        othtime = race_checkpoint_lasttimes[cp];
                }
                else
-                       lself = lother = othtime = 0;
+                       mylaps = lother = othtime = 0;
 
                if(IS_REAL_CLIENT(e))
                {
@@ -485,7 +485,7 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
                                else
                                {
                                        WriteInt24_t(MSG_ONE, TIME_ENCODE(time - race_checkpoint_lasttimes[cp]));
-                                       WriteByte(MSG_ONE, lself - lother);
+                                       WriteByte(MSG_ONE, mylaps - lother);
                                        WriteString(MSG_ONE, oth.netname); // record holder
                                }
                        });
@@ -493,7 +493,7 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
 
                race_checkpoint_lastplayers[cp] = e;
                race_checkpoint_lasttimes[cp] = time;
-               race_checkpoint_lastlaps[cp] = lself;
+               race_checkpoint_lastlaps[cp] = mylaps;
 
                if(IS_REAL_CLIENT(oth))
                {
@@ -511,7 +511,7 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
                                else
                                {
                                        WriteInt24_t(MSG_ONE, TIME_ENCODE(time - othtime));
-                                       WriteByte(MSG_ONE, lother - lself);
+                                       WriteByte(MSG_ONE, lother - mylaps);
                                        WriteString(MSG_ONE, e.netname); // record holder
                                }
                        });
@@ -570,7 +570,7 @@ void checkpoint_passed(entity this, entity player)
        {
                // do not allow portalling through checkpoints
                trace_plane_normal = normalize(-1 * player.velocity);
-               WITHSELF(player, W_Porto_Fail(0));
+               W_Porto_Fail(player, 0);
                return;
        }
 
@@ -581,7 +581,7 @@ void checkpoint_passed(entity this, entity player)
        {
                oldmsg = this.message;
                this.message = "";
-               SUB_UseTargets(this, player, player); // TODO: should we be using other for the trigger here?
+               SUB_UseTargets(this, player, player);
                this.message = oldmsg;
        }
 
@@ -709,8 +709,7 @@ void checkpoint_use(entity this, entity actor, entity trigger)
        if(trigger.classname == "info_player_deathmatch") // a spawn, a spawn
                return;
 
-       other = actor;
-       checkpoint_passed(this, other);
+       checkpoint_passed(this, actor);
 }
 
 bool race_waypointsprite_visible_for_player(entity this, entity player, entity view)