]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix console error (assignment to world) when a bot is removed while you are spectating it
authorterencehill <piuntn@gmail.com>
Wed, 30 May 2018 12:03:46 +0000 (14:03 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 30 May 2018 12:03:46 +0000 (14:03 +0200)
qcsrc/server/client.qc

index d374876d0456441bc59fdf69fe683a643bb8d42a..fff50d24959bb5b9d1ddb0fb4f99141409b8fced 100644 (file)
@@ -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);