Ensure hand drawn when throwing one of the dual sabers

This commit is contained in:
Simon 2023-07-13 22:10:04 +01:00
parent 1a6a99e2a7
commit 1477f452a8

View file

@ -2371,7 +2371,6 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) {
&& cg.predicted_player_state.stats[STAT_HEALTH] > 0 && cg.predicted_player_state.stats[STAT_HEALTH] > 0
&& cg.snap->ps.viewEntity < ENTITYNUM_WORLD && cg.snap->ps.viewEntity < ENTITYNUM_WORLD
&& g_entities[cg.snap->ps.viewEntity].client && g_entities[cg.snap->ps.viewEntity].client
&& !(g_entities[cg.snap->ps.viewEntity].client->ps.dualSabers && cg.snap->ps.weapon == WP_SABER)
&& !vr->weapon_stabilised && !vr->weapon_stabilised
&& !vr->in_vehicle && !vr->in_vehicle
&& !cg_pano.integer && !cg_pano.integer
@ -2379,6 +2378,7 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) {
{ {
vec3_t end, forward; vec3_t end, forward;
refEntity_t handEnt; refEntity_t handEnt;
centity_t *cent = &cg_entities[0];
memset( &handEnt, 0, sizeof(refEntity_t) ); memset( &handEnt, 0, sizeof(refEntity_t) );
BG_CalculateVRDefaultPosition(1, handEnt.origin, handEnt.angles); BG_CalculateVRDefaultPosition(1, handEnt.origin, handEnt.angles);
@ -2389,32 +2389,34 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) {
handEnt.renderfx = RF_DEPTHHACK | RF_VRVIEWMODEL; handEnt.renderfx = RF_DEPTHHACK | RF_VRVIEWMODEL;
if (cg.snap->ps.powerups[PW_FORCE_PUSH] > cg.time || if (!g_entities[cg.snap->ps.viewEntity].client->ps.dualSabers)
(cg.snap->ps.forcePowersActive & (1<<FP_GRIP)) ||
(cg.snap->ps.forcePowersActive & (1<<FP_LIGHTNING)) ||
(cg.snap->ps.forcePowersActive & (1<<FP_ABSORB)) ||
(cg.snap->ps.forcePowersActive & (1<<FP_DRAIN)) ||
(cg.snap->ps.forcePowersActive & (1<<FP_RAGE)))
{ {
handEnt.hModel = cgs.media.handModel_force; if (cg.snap->ps.powerups[PW_FORCE_PUSH] > cg.time ||
} (cg.snap->ps.forcePowersActive & (1<<FP_GRIP)) ||
else if (cg.snap->ps.weapon == WP_MELEE) (cg.snap->ps.forcePowersActive & (1<<FP_LIGHTNING)) ||
{ (cg.snap->ps.forcePowersActive & (1<<FP_ABSORB)) ||
handEnt.hModel = cgs.media.handModel_fist; (cg.snap->ps.forcePowersActive & (1<<FP_DRAIN)) ||
} (cg.snap->ps.forcePowersActive & (1<<FP_RAGE)))
else {
{ handEnt.hModel = cgs.media.handModel_force;
handEnt.hModel = cgs.media.handModel_relaxed; }
} else if (cg.snap->ps.weapon == WP_MELEE)
VectorCopy(handEnt.origin, handEnt.oldorigin); {
handEnt.hModel = cgs.media.handModel_fist;
}
else
{
handEnt.hModel = cgs.media.handModel_relaxed;
}
VectorCopy(handEnt.origin, handEnt.oldorigin);
AnglesToAxis(handEnt.angles, handEnt.axis); AnglesToAxis(handEnt.angles, handEnt.axis);
for ( int i = 0; i < 3; i++ ) { for ( int i = 0; i < 3; i++ ) {
VectorScale( handEnt.axis[i], (vr->right_handed || i != 1) ? 1.0f : -1.0f, handEnt.axis[i] ); VectorScale( handEnt.axis[i], (vr->right_handed || i != 1) ? 1.0f : -1.0f, handEnt.axis[i] );
} }
centity_t *cent = &cg_entities[0]; CG_AddRefEntityWithPowerups(&handEnt, cent->currentState.powerups, cent, true);
CG_AddRefEntityWithPowerups(&handEnt, cent->currentState.powerups, cent, true); }
if (cg.snap->ps.weapon == WP_NONE || if (cg.snap->ps.weapon == WP_NONE ||
cg.snap->ps.weapon == WP_MELEE || cg.snap->ps.weapon == WP_MELEE ||