]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Port killindicator_teamchange to ClientState
authorMario <mario@smbclan.net>
Sat, 15 Jul 2017 16:10:57 +0000 (02:10 +1000)
committerMario <mario@smbclan.net>
Sat, 15 Jul 2017 16:10:57 +0000 (02:10 +1000)
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/defs.qh
qcsrc/server/mutators/mutator/gamemode_ca.qc
qcsrc/server/player.qc

index db62a801f73120c67fa65caf2b4a23277970caa8..2f16303210038d9a869d137745f2abfaf2283468 100644 (file)
@@ -855,19 +855,19 @@ Called when a client types 'kill' in the console
 .float clientkill_nexttime;
 void ClientKill_Now_TeamChange(entity this)
 {
-       if(this.killindicator_teamchange == -1)
+       if(CS(this).killindicator_teamchange == -1)
        {
                JoinBestTeam( this, false, true );
        }
-       else if(this.killindicator_teamchange == -2)
+       else if(CS(this).killindicator_teamchange == -2)
        {
                if(blockSpectators)
                        Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
                PutObserverInServer(this);
        }
        else
-               SV_ChangeTeam(this, this.killindicator_teamchange - 1);
-       this.killindicator_teamchange = 0;
+               SV_ChangeTeam(this, CS(this).killindicator_teamchange - 1);
+       CS(this).killindicator_teamchange = 0;
 }
 
 void ClientKill_Now(entity this)
@@ -875,7 +875,7 @@ void ClientKill_Now(entity this)
        if(this.vehicle)
        {
            vehicles_exit(this.vehicle, VHEF_RELEASE);
-           if(!this.killindicator_teamchange)
+           if(!CS(this).killindicator_teamchange)
            {
             this.vehicle_health = -1;
             Damage(this, this, this, 1 , DEATH_KILL.m_id, this.origin, '0 0 0');
@@ -887,7 +887,7 @@ void ClientKill_Now(entity this)
 
        this.killindicator = NULL;
 
-       if(this.killindicator_teamchange)
+       if(CS(this).killindicator_teamchange)
                ClientKill_Now_TeamChange(this);
 
        if(!IS_SPEC(this) && !IS_OBSERVER(this))
@@ -950,7 +950,7 @@ void ClientKill_TeamChange (entity this, float targetteam) // 0 = don't change,
        return;
     killtime = M_ARGV(1, float);
 
-       this.killindicator_teamchange = targetteam;
+       CS(this).killindicator_teamchange = targetteam;
 
     if(!this.killindicator)
        {
index e85419cfe46b7124ebe8244c0e482036b0a30d98..15c49034c135fb5a12e4138677feaf90ac2adecf 100644 (file)
@@ -35,6 +35,7 @@ CLASS(Client, Object)
 
     ATTRIB(Client, parm_idlesince, int, this.parm_idlesince);
     ATTRIB(Client, muted, bool, this.muted);
+    ATTRIB(Client, killindicator_teamchange, int, this.killindicator_teamchange);
 
     METHOD(Client, m_unwind, bool(Client this));
 
index 7a155fddd9d69e732f38040d2a71af86617986e2..6d1c7e31737d01b1d6fb0fb0cd53454cb888b5ea 100644 (file)
@@ -226,7 +226,6 @@ int have_team_spawns_forteams; // if Xth bit is 1 then team X has spawns else it
 
 // set when showing a kill countdown
 .entity killindicator;
-.float killindicator_teamchange;
 
 void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
 
index fc06e50e29d73501a0e29d1c35d082325064fec3..8ef0a859e2927030c64a32d73fe52665c72c908f 100644 (file)
@@ -289,7 +289,7 @@ MUTATOR_HOOKFUNCTION(ca, MakePlayerObserver)
 
        if (!IS_DEAD(player))
                ca_LastPlayerForTeam_Notify(player);
-       if (player.killindicator_teamchange == -2) // player wants to spectate
+       if (CS(player).killindicator_teamchange == -2) // player wants to spectate
                player.caplayer = 0;
        if (player.caplayer)
                player.frags = FRAGS_LMS_LOSER;
index fcb29523c84a05ddeb9dac8923a14ed960491cd8..2ee4960654c2e99a641751b2b06812c152ef1f10 100644 (file)
@@ -536,7 +536,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
                {
                        delete(this.killindicator);
                        this.killindicator = NULL;
-                       if(this.killindicator_teamchange)
+                       if(CS(this).killindicator_teamchange)
                                defer_ClientKill_Now_TeamChange = true;
 
                        if(this.classname == "body")