From f717a8396e87a291a97d1a6ab9ace1eada160433 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 11 Oct 2019 19:41:06 -0500 Subject: [PATCH] Fix lightning gun handling for corpses and single player podiums The lightning trail is fired from the real non-predicted entity for the local client so it can show the server location. The real client entity was always used to check if a player entity is firing the lighting gun. This potentially causes corpses and players on single player podiums with lightning gun to render the lightning trail if the real (living) client is firing the lightning gun. I'm not aware of this causing any issues without modifying the game logic. Corpses have no weapon and it's not possible to fire during single player intermission. --- code/cgame/cg_weapons.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/cgame/cg_weapons.c b/code/cgame/cg_weapons.c index 644292ee..3906b4a0 100644 --- a/code/cgame/cg_weapons.c +++ b/code/cgame/cg_weapons.c @@ -1286,7 +1286,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent } // make sure we aren't looking at cg.predictedPlayerEntity for LG - nonPredictedCent = &cg_entities[cent->currentState.clientNum]; + nonPredictedCent = &cg_entities[cent->currentState.number]; // if the index of the nonPredictedCent is not the same as the clientNum // then this is a fake player (like on the single player podiums), so