]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_player.qc
Clean up/optimize racer code a bit. Make it use a simpler phys path when idle. Tweak...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_player.qc
index 5a162742387c471883838d67a24a478e21357786..fd14d42b8d9aa4718450f3a68591d0a4a04bfc0c 100644 (file)
@@ -360,7 +360,7 @@ void SpawnThrownWeapon (vector org, float w)
                float j;
                for(j = WEP_FIRST; j <= WEP_LAST; ++j)
                {
-                       if(self.weapons & W_WeaponBit(j))
+                       if(WEPSET_CONTAINS_EW(self, j))
                                if(W_IsWeaponThrowable(j))
                                        W_ThrowNewWeapon(self, j, FALSE, org, randomvec() * 175 + '0 0 325');
                }
@@ -599,6 +599,8 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
        vbot = (clienttype(self) == CLIENTTYPE_BOT);
 
        valid_damage_for_weaponstats = 0;
+       awep = 0;
+
        if(vbot || clienttype(self) == CLIENTTYPE_REAL)
        if(abot || clienttype(attacker) == CLIENTTYPE_REAL)
        if(attacker && self != attacker)
@@ -805,14 +807,12 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
 //   0 = reject
 //  -1 = fake accept
 {
-       string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr, privatemsgprefix;
-       float flood, privatemsgprefixlen;
+       string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr;
+       float flood;
        var .float flood_field;
        entity head;
        float ret;
-
-       if(Ban_MaybeEnforceBan(source))
-               return 0;
+       string privatemsgprefix = string_null; float privatemsgprefixlen = 0;
 
        if(!teamsay && !privatesay)
                if(substring(msgin, 0, 1) == " ")
@@ -825,7 +825,10 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
        else if(teamplay)
                colorstr = Team_ColorCode(source.team);
        else
+       {
+               colorstr = "";
                teamsay = FALSE;
+       }
 
        if(intermission_running)
                teamsay = FALSE;
@@ -884,6 +887,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
 
        // FLOOD CONTROL
        flood = 0;
+       flood_field = floodcontrol_chat;
        if(floodcontrol)
        {
                float flood_spl;
@@ -979,7 +983,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
        if(source.classname != "player")
        {
                if not(intermission_running)
-                       if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !inWarmupStage))
+                       if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !(inWarmupStage || gameover)))
                                teamsay = -1; // spectators
        }