]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/accuracy.qc
Unify boolean constants
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / accuracy.qc
index 09d42332ae51dbf408a4284fdbd7b947f0fb517b..2c6d918540bdf5b0cda54436a57a993d99b6b261 100644 (file)
@@ -25,7 +25,7 @@ float accuracy_send(entity to, float sf)
        // note: zero sendflags can never be sent... so we can use that to say that we send no accuracy!
        WriteInt24_t(MSG_ENTITY, sf);
        if(sf == 0)
-               return TRUE;
+               return true;
        // note: we know that client and server agree about SendFlags...
        for(w = 0, f = 1; w <= WEP_LAST - WEP_FIRST; ++w)
        {
@@ -36,7 +36,7 @@ float accuracy_send(entity to, float sf)
                else
                        f *= 2;
        }
-       return TRUE;
+       return true;
 }
 
 // init/free
@@ -46,7 +46,7 @@ void accuracy_init(entity e)
        e.accuracy.owner = e;
        e.accuracy.classname = "accuracy";
        e.accuracy.drawonlytoclient = e;
-       Net_LinkEntity(e.accuracy, FALSE, 0, accuracy_send);
+       Net_LinkEntity(e.accuracy, false, 0, accuracy_send);
 }
 
 void accuracy_free(entity e)
@@ -94,7 +94,7 @@ void accuracy_add(entity e, float w, float fired, float hit)
 
        if(b == accuracy_byte(a.(accuracy_hit[w]), a.(accuracy_fired[w])))
                return;
-       w = pow(2, mod(w, 24));
+       w = pow(2, w % 24);
        a.SendFlags |= w;
        FOR_EACH_CLIENT(a)
                if(IS_SPEC(a))
@@ -110,15 +110,16 @@ float accuracy_isgooddamage(entity attacker, entity targ)
 
        if(!warmup_stage)
        if(targ.deadflag == DEAD_NO)
+       if(!targ.frozen)
        if(mutator_check == MUT_ACCADD_INVALID || (mutator_check == MUT_ACCADD_VALID && IS_CLIENT(targ)))
        if(DIFF_TEAM(attacker, targ))
-               return TRUE;
-       return FALSE;
+               return true;
+       return false;
 }
 
 float accuracy_canbegooddamage(entity attacker)
 {
        if(!warmup_stage)
-               return TRUE;
-       return FALSE;
+               return true;
+       return false;
 }