]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Check PVS before sending casings
authorbones_was_here <bones_was_here@xonotic.au>
Tue, 22 Nov 2022 15:26:58 +0000 (01:26 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Tue, 13 Dec 2022 01:18:24 +0000 (11:18 +1000)
...to players who don't own them and aren't spectating their owner

qcsrc/common/effects/qc/casings.qc

index 08864459dbaed7c6a76fd8a85eda3d60efe07940..4f91acf914cc1cad9340fe6da73cf640270a61eb 100644 (file)
@@ -32,6 +32,8 @@ void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float ran
 
                        casingtype |= 0x40; // client will apply autocvar_cl_gunoffset in first person
                }
+               else if (1 & ~checkpvs(it.origin + it.view_ofs, casingowner)) // 1 or 3 means visible
+                       continue;
 
                msg_entity = it; // sound_allowed checks this
                if (!sound_allowed(MSG_ONE, it))