]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Skip some checks if checking sound_allowed on a null entity
authorMario <mario@smbclan.net>
Tue, 16 Oct 2018 20:13:24 +0000 (06:13 +1000)
committerMario <mario@smbclan.net>
Tue, 16 Oct 2018 20:13:24 +0000 (06:13 +1000)
qcsrc/common/sounds/all.qc

index 328486d35470cfc3594e437742d6428d2426a14c..fcd4d9a459983fc06a2e35fdb1cd5e8db753e8b9 100644 (file)
@@ -8,6 +8,7 @@ bool autocvar_bot_sound_monopoly;
 .entity realowner;
 bool sound_allowed(int to, entity e)
 {
+       if(!e) return true; // save on a few checks
        for ( ; ; )
        {
                if (e.classname == "body") e = e.enemy;