]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/accuracy.qc
Merge branch 'master' into terencehill/accuracy_shotgun
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / accuracy.qc
index 71503718aa4b9dc40fdd7bb306d032e49663e513..879dd88327bdf17824d08dfd85c7a819ceb4010b 100644 (file)
@@ -20,10 +20,10 @@ bool accuracy_send(entity this, entity to, int sf)
 
        entity a = this.owner;
        if (IS_SPEC(a)) a = a.enemy;
 
        entity a = this.owner;
        if (IS_SPEC(a)) a = a.enemy;
-       a = a.accuracy;
+       a = CS(a).accuracy;
 
        if (to != a.owner)
 
        if (to != a.owner)
-               if (!autocvar_sv_accuracy_data_share && !a.owner.cvar_cl_accuracy_data_share)
+               if (!autocvar_sv_accuracy_data_share && !CS(a.owner).cvar_cl_accuracy_data_share)
                        sf = 0;
        // note: zero sendflags can never be sent... so we can use that to say that we send no accuracy!
        WriteInt24_t(MSG_ENTITY, sf);
                        sf = 0;
        // note: zero sendflags can never be sent... so we can use that to say that we send no accuracy!
        WriteInt24_t(MSG_ENTITY, sf);
@@ -40,7 +40,7 @@ bool accuracy_send(entity this, entity to, int sf)
 // init/free
 void accuracy_init(entity e)
 {
 // init/free
 void accuracy_init(entity e)
 {
-       entity a = e.accuracy = new_pure(accuracy);
+       entity a = CS(e).accuracy = new_pure(accuracy);
        a.owner = e;
        a.drawonlytoclient = e;
        Net_LinkEntity(a, false, 0, accuracy_send);
        a.owner = e;
        a.drawonlytoclient = e;
        Net_LinkEntity(a, false, 0, accuracy_send);
@@ -48,13 +48,13 @@ void accuracy_init(entity e)
 
 void accuracy_free(entity e)
 {
 
 void accuracy_free(entity e)
 {
-       delete(e.accuracy);
+       delete(CS(e).accuracy);
 }
 
 // force a resend of a player's accuracy stats
 void accuracy_resend(entity e)
 {
 }
 
 // force a resend of a player's accuracy stats
 void accuracy_resend(entity e)
 {
-       e.accuracy.SendFlags = 0xFFFFFF;
+       CS(e).accuracy.SendFlags = 0xFFFFFF;
 }
 
 // update accuracy stats
 }
 
 // update accuracy stats
@@ -64,7 +64,7 @@ void accuracy_resend(entity e)
 void accuracy_add(entity this, int w, int fired, int hit)
 {
        if (IS_INDEPENDENT_PLAYER(this)) return;
 void accuracy_add(entity this, int w, int fired, int hit)
 {
        if (IS_INDEPENDENT_PLAYER(this)) return;
-       entity a = this.accuracy;
+       entity a = CS(this).accuracy;
        if (!a) return;
        if (!hit && !fired) return;
        w -= WEP_FIRST;
        if (!a) return;
        if (!hit && !fired) return;
        w -= WEP_FIRST;
@@ -85,7 +85,7 @@ void accuracy_add(entity this, int w, int fired, int hit)
        if (b == accuracy_byte(a.accuracy_hit[w], a.accuracy_fired[w])) return; // no change
        int sf = 1 << (w % 24);
        a.SendFlags |= sf;
        if (b == accuracy_byte(a.accuracy_hit[w], a.accuracy_fired[w])) return; // no change
        int sf = 1 << (w % 24);
        a.SendFlags |= sf;
-       FOREACH_CLIENT(IS_SPEC(it) && it.enemy == this, LAMBDA(it.accuracy.SendFlags |= sf));
+       FOREACH_CLIENT(IS_SPEC(it) && it.enemy == this, { CS(it).accuracy.SendFlags |= sf; });
 }
 
 bool accuracy_isgooddamage(entity attacker, entity targ)
 }
 
 bool accuracy_isgooddamage(entity attacker, entity targ)