Skip to content

Commit

Permalink
Server: Target player when running god
Browse files Browse the repository at this point in the history
  • Loading branch information
MotoLegacy committed May 9, 2022
1 parent f11f58b commit 0ccb635
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions source/server/player.qc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0ccb635

Please sign in to comment.