From 0ccb6357f0d43a94898774fa183b7a2f7c3f3c8a Mon Sep 17 00:00:00 2001 From: moto Date: Mon, 9 May 2022 13:49:56 -0400 Subject: [PATCH] Server: Target player when running god --- source/server/player.qc | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/source/server/player.qc b/source/server/player.qc index 0a43a93..239ddb2 100644 --- a/source/server/player.qc +++ b/source/server/player.qc @@ -733,6 +733,24 @@ void(string com) SV_ParseClientCommand = self = benis; #endif } + else if (com == "god") + { + #ifndef PC + entity benis2 = self; + other = find(world, classname, "player"); + self = other; + #endif + + if (!(self.flags & FL_GODMODE)) + self.flags = self.flags | FL_GODMODE; + else + self.flags = self.flags & (~FL_GODMODE); + + #ifndef PC + localcmd(com); + self = benis2; + #endif + } else { tokenize(com); @@ -777,13 +795,7 @@ void(string com) SV_ParseClientCommand = self.Weapon_Name = GetWeaponName(self.weapon); #endif } - break; - case "god": - if (!(self.flags & FL_GODMODE)) - self.flags = self.flags | FL_GODMODE; - else - self.flags = self.flags & (~FL_GODMODE); - break; + break; case "nextround": rounds++; break;