]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_nexball.qc
Replace all player/bot/spectator classname checks with macros
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_nexball.qc
index 62cfd01ad867250673f406bfc68ab7ea99841671..2dd1b3c2425a77684d0b8210bc7ca1b60997327d 100644 (file)
@@ -247,7 +247,7 @@ void football_touch(void)
                        self.nextthink = time + autocvar_g_nexball_delay_idle;
                return;
        }
-       if(other.classname != "player")
+       if not(IS_PLAYER(other))
                return;
        if(other.health < 1)
                return;
@@ -287,7 +287,7 @@ void basketball_touch(void)
                football_touch();
                return;
        }
-       if(!self.cnt && other.classname == "player" && (other != self.nb_dropper || time > self.nb_droptime + autocvar_g_nexball_delay_collect))
+       if(!self.cnt && IS_PLAYER(other) && (other != self.nb_dropper || time > self.nb_droptime + autocvar_g_nexball_delay_collect))
        {
                if(other.health <= 0)
                        return;
@@ -326,7 +326,7 @@ void GoalTouch(void)
        else
                otherteam = 0;
 
-       if((isclient = ball.pusher.flags & FL_CLIENT))
+       if((isclient = IS_CLIENT(ball.pusher)))
                pname = ball.pusher.netname;
        else
                pname = "Someone (?)";
@@ -673,7 +673,7 @@ void W_Nexball_Touch(void)
        
        PROJECTILE_TOUCH;
        if(attacker.team != other.team || autocvar_g_nexball_basketball_teamsteal)
-               if((ball = other.ballcarried) && (attacker.classname == "player"))
+               if((ball = other.ballcarried) && (IS_PLAYER(attacker)))
                {
                        other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * autocvar_g_balance_nexball_secondary_force;
                        other.flags &~= FL_ONGROUND;
@@ -905,7 +905,7 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink)
                                //tracebox(self.origin + self.view_ofs, '-2 -2 -2', '2 2 2', self.origin + self.view_ofs + v_forward * autocvar_g_nexball_safepass_maxdist);
                                crosshair_trace(self);
                                if( trace_ent && 
-                                       trace_ent.flags & FL_CLIENT &&
+                                       IS_CLIENT(trace_ent) &&
                                        trace_ent.deadflag == DEAD_NO &&
                                        trace_ent.team == self.team &&
                                        vlen(trace_ent.origin - self.origin) <= autocvar_g_nexball_safepass_maxdist )