Skip to content
Permalink
Browse files

cgame: fix bad impl of ref ent for eject brass

This commit 41fba9a was causing trouble with gib and shadow player
  • Loading branch information...
Aranud committed Aug 12, 2019
1 parent e5739cf commit 453d47b156c384a89b8a532059fd83b4253b432f
Showing with 5 additions and 5 deletions.
  1. +1 −1 src/cgame/cg_local.h
  2. +4 −4 src/cgame/cg_weapons.c
@@ -307,7 +307,7 @@ typedef struct
int lightningFiring;

// so we can do fast tag grabbing
refEntity_t bodyRefEnt, headRefEnt, gunRefEnt;
refEntity_t bodyRefEnt, headRefEnt, gunRefEnt, handRefEnt;
int gunRefEntFrame;

float animSpeed; ///< for manual adjustment
@@ -148,7 +148,7 @@ void CG_MachineGunEjectBrass(centity_t *cent)

Com_Memset(&brass, 0, sizeof(brass));

CG_PositionRotatedEntityOnTag(&brass, &cg.predictedPlayerEntity.pe.bodyRefEnt, "tag_brass");
CG_PositionRotatedEntityOnTag(&brass, &cg.predictedPlayerEntity.pe.handRefEnt, "tag_brass");

VectorMA(brass.origin, 6, brass.axis[0], re->origin);
}
@@ -195,11 +195,11 @@ void CG_MachineGunEjectBrass(centity_t *cent)

if ((GetWeaponTableData(cent->currentState.weapon)->attributes & WEAPON_ATTRIBUT_AKIMBO) && !cent->akimboFire)
{
CG_PositionRotatedEntityOnTag(&brass, &cg.predictedPlayerEntity.pe.bodyRefEnt, "tag_brass2");
CG_PositionRotatedEntityOnTag(&brass, &cg.predictedPlayerEntity.pe.handRefEnt, "tag_brass2");
}
else
{
CG_PositionRotatedEntityOnTag(&brass, &cg.predictedPlayerEntity.pe.bodyRefEnt, "tag_brass");
CG_PositionRotatedEntityOnTag(&brass, &cg.predictedPlayerEntity.pe.handRefEnt, "tag_brass");
}

VectorCopy(brass.origin, re->origin);
@@ -3121,7 +3121,7 @@ void CG_AddPlayerWeapon(refEntity_t *parent, playerState_t *ps, centity_t *cent)
*/
void CG_AddViewWeapon(playerState_t *ps)
{
refEntity_t *hand = &cg.predictedPlayerEntity.pe.bodyRefEnt; // use body to store hand
refEntity_t *hand = &cg.predictedPlayerEntity.pe.handRefEnt;
float fovOffset;
vec3_t angles;
vec3_t gunoff;

0 comments on commit 453d47b

Please sign in to comment.
You can’t perform that action at this time.