]> 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 bee961bc080d0aecd64ccc284e02a0d49be4517b..879dd88327bdf17824d08dfd85c7a819ceb4010b 100644 (file)
@@ -23,7 +23,7 @@ bool accuracy_send(entity this, entity to, int sf)
        a = CS(a).accuracy;
 
        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);
@@ -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;
-       FOREACH_CLIENT(IS_SPEC(it) && it.enemy == this, LAMBDA(CS(it).accuracy.SendFlags |= sf));
+       FOREACH_CLIENT(IS_SPEC(it) && it.enemy == this, { CS(it).accuracy.SendFlags |= sf; });
 }
 
 bool accuracy_isgooddamage(entity attacker, entity targ)
@@ -93,8 +93,8 @@ bool accuracy_isgooddamage(entity attacker, entity targ)
        int mutator_check = MUTATOR_CALLHOOK(AccuracyTargetValid, attacker, targ);
 
        if (warmup_stage) return false;
-       if (IS_DEAD(targ)) return false;
-       if (STAT(FROZEN, targ)) return false;
+       if (IS_DEAD(targ) && time > targ.death_time) return false;
+       if (STAT(FROZEN, targ) && time > targ.freeze_time) return false;
        if (SAME_TEAM(attacker, targ)) return false;
 
        if (mutator_check == MUT_ACCADD_INVALID) return true;