From: terencehill Date: Wed, 30 May 2018 12:03:46 +0000 (+0200) Subject: Fix console error (assignment to world) when a bot is removed while you are spectating it X-Git-Tag: xonotic-v0.8.5~2123 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1d08a9fbac809f72d4c0df02250303313b07167a;p=xonotic%2Fxonotic-data.pk3dir.git Fix console error (assignment to world) when a bot is removed while you are spectating it --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index d374876d0..fff50d249 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -152,10 +152,15 @@ void ClientData_Detach(entity this) void ClientData_Touch(entity e) { - CS(e).clientdata.SendFlags = 1; + entity cd = CS(e).clientdata; + if (cd) { cd.SendFlags = 1; } // make it spectatable - FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != e && IS_SPEC(it) && it.enemy == e, { CS(it).clientdata.SendFlags = 1; }); + FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != e && IS_SPEC(it) && it.enemy == e, + { + entity cd = CS(it).clientdata; + if (cd) { cd.SendFlags = 1; } + }); } void SetSpectatee(entity this, entity spectatee);