]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
It should be safe to remove this safety check
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index bb4fc2335877f3834e38ca1b865dbafda00f7df1..637530cbfe630f9ecaeaf3ae4ce49ac11f41683c 100644 (file)
@@ -273,7 +273,7 @@ void PutObserverInServer()
        self.crouch = false;
        self.revival_time = 0;
 
-       setorigin (self, (spot.origin + PL_VIEW_OFS)); // offset it so that the spectator spawns higher off the ground, looks better this way
+       setorigin (self, (spot.origin + STAT(PL_VIEW_OFS, NULL))); // offset it so that the spectator spawns higher off the ground, looks better this way
        self.prevorigin = self.origin;
        self.items = 0;
        self.weapons = '0 0 0';
@@ -282,7 +282,7 @@ void PutObserverInServer()
        setmodel(self, MDL_Null);
        self.drawonlytoclient = self;
 
-       setsize (self, PL_CROUCH_MIN, PL_CROUCH_MAX); // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
+       setsize (self, STAT(PL_CROUCH_MIN, NULL), STAT(PL_CROUCH_MAX, NULL)); // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
        self.view_ofs = '0 0 0'; // so that your view doesn't go into the ceiling with MOVETYPE_FLY_WORLDONLY, previously "PL_VIEW_OFS"
 
        PS(self).m_weapon = WEP_Null;
@@ -542,8 +542,8 @@ void PutClientInServer()
                this.drawonlytoclient = NULL;
 
                this.crouch = false;
-               this.view_ofs = PL_VIEW_OFS;
-               setsize(this, PL_MIN, PL_MAX);
+               this.view_ofs = STAT(PL_VIEW_OFS, NULL);
+               setsize(this, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
                this.spawnorigin = spot.origin;
                setorigin(this, spot.origin + '0 0 1' * (1 - this.mins.z - 24));
                // don't reset back to last position, even if new position is stuck in solid
@@ -835,13 +835,13 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
 
     if(!self.killindicator)
        {
-               if(self.deadflag == DEAD_NO)
+               if(!IS_DEAD(self))
                {
                        killtime = max(killtime, self.clientkill_nexttime - time);
                        self.clientkill_nexttime = time + killtime + autocvar_g_balance_kill_antispam;
                }
 
-               if(killtime <= 0 || !IS_PLAYER(self) || self.deadflag != DEAD_NO)
+               if(killtime <= 0 || !IS_PLAYER(self) || IS_DEAD(self))
                {
                        ClientKill_Now();
                }
@@ -1733,12 +1733,12 @@ bool Spectate(entity pl)
 
 bool SpectateNext()
 {SELFPARAM();
-       other = find(self.enemy, classname, "player");
+       other = find(self.enemy, classname, STR_PLAYER);
 
        if (MUTATOR_CALLHOOK(SpectateNext, self, other))
                other = spec_player;
        else if (!other)
-               other = find(other, classname, "player");
+               other = find(other, classname, STR_PLAYER);
 
        if(other) { SetSpectatee(self, other); }
 
@@ -1748,7 +1748,7 @@ bool SpectateNext()
 bool SpectatePrev()
 {SELFPARAM();
        // NOTE: chain order is from the highest to the lower entnum (unlike find)
-       other = findchain(classname, "player");
+       other = findchain(classname, STR_PLAYER);
        if (!other) // no player
                return false;
 
@@ -1791,7 +1791,7 @@ Update a respawn countdown display.
 void ShowRespawnCountdown()
 {SELFPARAM();
        float number;
-       if(self.deadflag == DEAD_NO) // just respawned?
+       if(!IS_DEAD(self)) // just respawned?
                return;
        else
        {
@@ -2050,7 +2050,7 @@ void PlayerUseKey()
        else if(autocvar_g_vehicles_enter)
        {
                if(!self.frozen)
-               if(self.deadflag == DEAD_NO)
+               if(!IS_DEAD(self))
                if(!gameover)
                {
                        entity head, closest_target = world;
@@ -2059,7 +2059,7 @@ void PlayerUseKey()
                        while(head) // find the closest acceptable target to enter
                        {
                                if(head.vehicle_flags & VHF_ISVEHICLE)
-                               if(head.deadflag == DEAD_NO)
+                               if(!IS_DEAD(head))
                                if(!head.owner || ((head.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(head.owner, self)))
                                if(head.takedamage != DAMAGE_NO)
                                {
@@ -2209,12 +2209,12 @@ void PlayerPreThink ()
        if(!gameover)
        if(!self.frozen)
        if(!self.vehicle)
-       if(self.deadflag == DEAD_NO)
+       if(!IS_DEAD(self))
        {
                entity veh;
                for(veh = world; (veh = findflags(veh, vehicle_flags, VHF_ISVEHICLE)); )
                if(vlen(veh.origin - self.origin) < autocvar_g_vehicles_enter_radius)
-               if(veh.deadflag == DEAD_NO)
+               if(!IS_DEAD(veh))
                if(veh.takedamage != DAMAGE_NO)
                if((veh.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(veh.owner, self))
                        Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_VEHICLE_ENTER_GUNNER);
@@ -2261,7 +2261,7 @@ void PlayerPreThink ()
                        player_powerups();
                }
 
-               if (self.deadflag != DEAD_NO)
+               if (IS_DEAD(self))
                {
                        if(self.personal && g_race_qualifying)
                        {
@@ -2465,7 +2465,7 @@ void PlayerPreThink ()
 
 void DrownPlayer(entity this)
 {
-       if(this.deadflag != DEAD_NO)
+       if(IS_DEAD(this))
                return;
 
        if (this.waterlevel != WATERLEVEL_SUBMERGED)