Fixed using turret guns when saber equipped

by switch to WP_NONE
This commit is contained in:
Simon 2023-06-20 22:17:59 +01:00
parent 0723c2335e
commit 0a7fac269f
5 changed files with 24 additions and 15 deletions

View file

@ -30,13 +30,6 @@ Authors : Simon Brown
#include "../OpenJK/code/game/g_vehicles.h"
#endif
void SV_Trace( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask, int capsule );
static inline float AngleBetweenVectors(const vec3_t a, const vec3_t b)
{
return RAD2DEG(acosf(DotProduct(a, b)/(VectorLength(a) * VectorLength(b))));
}
void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, ovrInputStateTrackedRemote *pDominantTrackedRemoteOld, ovrTrackedController* pDominantTracking,
ovrInputStateTrackedRemote *pOffTrackedRemoteNew, ovrInputStateTrackedRemote *pOffTrackedRemoteOld, ovrTrackedController* pOffTracking,
int domButton1, int domButton2, int offButton1, int offButton2 )
@ -559,7 +552,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
} else if (cl.frame.ps.weapon == WP_SABER ||
cl.frame.ps.weapon == WP_STUN_BATON) {
//Does weapon velocity trigger attack
if (vr.velocitytriggered) {
if (vr.velocitytriggered && !vr.remote_turret) {
if (vr.velocitytriggeractive)
{
static bool fired = false;
@ -762,7 +755,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
int thirdPerson = Cvar_VariableIntegerValue("cg_thirdPerson");
if (cl.frame.ps.weapon == WP_SABER && !thirdPerson &&
if (cl.frame.ps.weapon == WP_SABER && !thirdPerson && !vr.remote_turret &&
vr.cgzoommode == 0 && cl.frame.ps.stats[STAT_HEALTH] > 0)
{
static bool previous_throwing = false;
@ -782,7 +775,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
sendButtonAction("+altattack", throwing);
}
}
else if (!vr.velocitytriggered) // Don't fire velocity triggered weapons
else if (!vr.velocitytriggered || vr.remote_turret) // Don't fire velocity triggered weapons
{
//Fire Primary - Doesn't trigger the saber
if ((pDominantTrackedRemoteNew->Buttons & xrButton_Trigger) !=

View file

@ -3281,7 +3281,10 @@ static void CG_ScanForCrosshairEntity( qboolean scanAll )
}
*/
//draw crosshair at endpoint
//CG_DrawCrosshair( trace.endpos );
if (vr->remote_turret)
{
CG_DrawCrosshair(trace.endpos);
}
g_crosshairEntNum = trace.entityNum;
g_crosshairEntDist = 4096*trace.fraction;

View file

@ -6939,7 +6939,7 @@ extern qboolean G_GetRootSurfNameWithVariant( gentity_t *ent, const char *rootSu
extern qboolean G_ControlledByPlayer( gentity_t *self );
extern qboolean G_RagDoll(gentity_t *ent, vec3_t forcedAngles);
int cg_saberOnSoundTime[MAX_GENTITIES] = {0};
extern void CG_ChangeWeapon( int num );
void CG_Player( centity_t *cent ) {
clientInfo_t *ci;
qboolean shadow, staticScale = qfalse;
@ -7004,6 +7004,15 @@ void CG_Player( centity_t *cent ) {
{
wData = &weaponData[cent->currentState.weapon];
}
//If viewing a remote turret, ensure we have switched to no weapons
if (vr->remote_turret &&
cg.weaponSelect != WP_NONE)
{
cg.weaponSelect = WP_NONE;
SetWeaponSelectTime();
}
/*
Ghoul2 Insert Start
*/

View file

@ -2046,8 +2046,12 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) {
CG_BuildSolidList();
if ( stereoView == STEREO_LEFT )
{
// set up cg.snap and possibly cg.nextSnap
CG_ProcessSnapshots();
}
// if we haven't received any snapshots yet, all
// we can draw is the information screen
if ( !cg.snap ) {

View file

@ -8964,7 +8964,7 @@ static void PM_BeginWeaponChange( int weapon ) {
return;
}
if ( !( pm->ps->stats[STAT_WEAPONS] & ( 1 << weapon ) ) ) {
if ( weapon != WP_NONE && !( pm->ps->stats[STAT_WEAPONS] & ( 1 << weapon ) ) ) {
return;
}