Permalink
Browse files

MP: Server gamecode fix for rancors causing spectators to appear

This commit fixes #875.

G_HeldByMonster was being called on the player and any following spectators every frame. The latter of which is unnecessary.
  • Loading branch information...
ensiform committed Jan 3, 2018
1 parent 01dd490 commit 32dcb33b670ba0695eb9463097eaa9a0d2070303
Showing with 5 additions and 2 deletions.
  1. +5 −2 codemp/game/g_active.c
View
@@ -1881,6 +1881,7 @@ void ClientThink_real( gentity_t *ent ) {
qboolean isNPC = qfalse;
qboolean controlledByPlayer = qfalse;
qboolean killJetFlags = qtrue;
qboolean isFollowing;
client = ent->client;
@@ -1918,7 +1919,9 @@ void ClientThink_real( gentity_t *ent ) {
}
}
if (!(client->ps.pm_flags & PMF_FOLLOW))
isFollowing = (client->ps.pm_flags & PMF_FOLLOW) ? qtrue : qfalse;
if (!isFollowing)
{
if (level.gametype == GT_SIEGE &&
client->siegeClass != -1 &&
@@ -2002,7 +2005,7 @@ void ClientThink_real( gentity_t *ent ) {
// mark the time, so the connection sprite can be removed
ucmd = &ent->client->pers.cmd;
if ( client && (client->ps.eFlags2&EF2_HELD_BY_MONSTER) )
if ( client && !isFollowing && (client->ps.eFlags2&EF2_HELD_BY_MONSTER) )
{
G_HeldByMonster( ent, ucmd );
}

0 comments on commit 32dcb33

Please sign in to comment.