mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-21 19:51:33 +00:00
Make getting into AT-ST easier
This commit is contained in:
parent
d121206f83
commit
b9d0314a6a
2 changed files with 34 additions and 14 deletions
|
@ -1669,6 +1669,14 @@ qboolean CanUseInfrontOf(gentity_t *ent)
|
|||
return qfalse;
|
||||
}
|
||||
|
||||
// Check if player is standing on drivable AT-ST
|
||||
if (ent->client->ps.groundEntityNum < ENTITYNUM_WORLD) {
|
||||
target = &g_entities[ent->client->ps.groundEntityNum];
|
||||
if (target && target->e_UseFunc == useF_misc_atst_use) {
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
bool thirdPersonActive = gi.cvar("cg_thirdPerson", "0", CVAR_TEMP)->integer;
|
||||
if (thirdPersonActive) {
|
||||
VectorCopy(ent->currentOrigin, src);
|
||||
|
@ -1712,13 +1720,6 @@ qboolean CanUseInfrontOf(gentity_t *ent)
|
|||
return qfalse;
|
||||
}
|
||||
}
|
||||
else if ( target->e_UseFunc == useF_misc_atst_use )
|
||||
{//drivable AT-ST from JK2
|
||||
if ( ent->client->ps.groundEntityNum != target->s.number )
|
||||
{//must be standing on it to use it
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
else if ( target->NPC!=NULL && target->health<=0 )
|
||||
{
|
||||
return qfalse;
|
||||
|
@ -1771,6 +1772,15 @@ void TryUse_Internal( bool offHand, gentity_t *ent, vec3_t src, vec3_t vf )
|
|||
trace_t trace;
|
||||
vec3_t dest;
|
||||
|
||||
// Drivable AT-ST can be used if player stands on it
|
||||
if (ent->client->ps.groundEntityNum < ENTITYNUM_WORLD) {
|
||||
target = &g_entities[ent->client->ps.groundEntityNum];
|
||||
if (target && target->e_UseFunc == useF_misc_atst_use) {
|
||||
GEntity_UseFunc( target, ent, ent );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//extend to find end of use trace
|
||||
bool thirdPersonActive = gi.cvar("cg_thirdPerson", "0", CVAR_TEMP)->integer;
|
||||
bool useGestureEnabled = gi.cvar("vr_gesture_triggered_use", "1", CVAR_ARCHIVE)->integer; // defined in VrCvars.h
|
||||
|
|
|
@ -1442,6 +1442,14 @@ qboolean CanUseInfrontOf(gentity_t *ent)
|
|||
return qfalse;
|
||||
}
|
||||
|
||||
// Check if player is standing on drivable AT-ST
|
||||
if (ent->client->ps.groundEntityNum < ENTITYNUM_WORLD) {
|
||||
target = &g_entities[ent->client->ps.groundEntityNum];
|
||||
if (target && target->e_UseFunc == useF_misc_atst_use) {
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
bool thirdPersonActive = gi.cvar("cg_thirdPerson", "0", CVAR_TEMP)->integer;
|
||||
if (thirdPersonActive) {
|
||||
VectorCopy(ent->currentOrigin, src);
|
||||
|
@ -1485,13 +1493,6 @@ qboolean CanUseInfrontOf(gentity_t *ent)
|
|||
return qfalse;
|
||||
}
|
||||
}
|
||||
else if ( target->e_UseFunc == useF_misc_atst_use )
|
||||
{//drivable AT-ST from JK2
|
||||
if ( ent->client->ps.groundEntityNum != target->s.number )
|
||||
{//must be standing on it to use it
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
else if ( target->NPC!=NULL && target->health<=0 )
|
||||
{
|
||||
return qfalse;
|
||||
|
@ -1536,6 +1537,15 @@ void TryUse_Internal( bool offHand, gentity_t *ent, vec3_t src, vec3_t vf ) {
|
|||
trace_t trace;
|
||||
vec3_t dest;
|
||||
|
||||
// Drivable AT-ST can be used if player stands on it
|
||||
if (ent->client->ps.groundEntityNum < ENTITYNUM_WORLD) {
|
||||
target = &g_entities[ent->client->ps.groundEntityNum];
|
||||
if (target && target->e_UseFunc == useF_misc_atst_use) {
|
||||
GEntity_UseFunc( target, ent, ent );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//extend to find end of use trace
|
||||
bool thirdPersonActive = gi.cvar("cg_thirdPerson", "0", CVAR_TEMP)->integer;
|
||||
bool useGestureEnabled = gi.cvar("vr_gesture_triggered_use", "1", CVAR_ARCHIVE)->integer; // defined in VrCvars.h
|
||||
|
|
Loading…
Reference in a new issue