From: Mario Date: Tue, 16 Oct 2018 20:13:24 +0000 (+1000) Subject: Skip some checks if checking sound_allowed on a null entity X-Git-Tag: xonotic-v0.8.5~1764 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=da20f5dec60594df2701e169b9438c1ee55c0607;p=xonotic%2Fxonotic-data.pk3dir.git Skip some checks if checking sound_allowed on a null entity --- diff --git a/qcsrc/common/sounds/all.qc b/qcsrc/common/sounds/all.qc index 328486d35..fcd4d9a45 100644 --- a/qcsrc/common/sounds/all.qc +++ b/qcsrc/common/sounds/all.qc @@ -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;