mirror of
https://github.com/DrBeef/JKXR.git
synced 2025-06-03 10:20:48 +00:00
Fix for crash in Dark Forces mod
This commit is contained in:
parent
304ab40190
commit
88e4e2f8ba
1 changed files with 31 additions and 23 deletions
|
@ -224,17 +224,24 @@ void Touch_Multi( gentity_t *self, gentity_t *other, trace_t *trace )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool useGestureAllowed = false;
|
||||||
|
if (vr)
|
||||||
|
{
|
||||||
bool thirdPersonActive = gi.cvar("cg_thirdPerson", "0", CVAR_TEMP)->integer;
|
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
|
cvar_t *vr_gesture_triggered_use = gi.cvar("vr_gesture_triggered_use", "1", CVAR_ARCHIVE);
|
||||||
bool useGestureAllowed = useGestureEnabled && !thirdPersonActive && !vr->remote_droid;
|
bool useGestureEnabled = vr_gesture_triggered_use == nullptr ||
|
||||||
if ( (self->spawnflags & 2) && ( !( self->spawnflags & 4 ) || ( ( self->spawnflags & 4) && !useGestureAllowed ) ) )
|
vr_gesture_triggered_use->integer; // defined in VrCvars.h
|
||||||
|
useGestureAllowed = useGestureEnabled && !thirdPersonActive && !vr->remote_droid;
|
||||||
|
if ((self->spawnflags & 2) &&
|
||||||
|
(!(self->spawnflags & 4) || ((self->spawnflags & 4) && !useGestureAllowed)))
|
||||||
{ // FACING and... ...is not USE_BUTTON or... ...is USE_BUTTON but use gestures are not active
|
{ // FACING and... ...is not USE_BUTTON or... ...is USE_BUTTON but use gestures are not active
|
||||||
// In case of buttons activated by use gesture, we do not need to check if we are facing them as we are touching them by hand.
|
// In case of buttons activated by use gesture, we do not need to check if we are facing them as we are touching them by hand.
|
||||||
vec3_t forward;
|
vec3_t forward;
|
||||||
|
|
||||||
if (other->client)
|
if (other->client)
|
||||||
{
|
{
|
||||||
if ( (other->client->ps.clientNum == 0) && (self->spawnflags & 4) && !thirdPersonActive && !vr->remote_droid )
|
if ((other->client->ps.clientNum == 0) && (self->spawnflags & 4) &&
|
||||||
|
!thirdPersonActive && !vr->remote_droid)
|
||||||
{
|
{
|
||||||
// In case of USE_BUTTON, check facing by controller and not by head (if not in 3rd person or controlling droid)
|
// In case of USE_BUTTON, check facing by controller and not by head (if not in 3rd person or controlling droid)
|
||||||
vec3_t origin, angles;
|
vec3_t origin, angles;
|
||||||
|
@ -256,6 +263,7 @@ void Touch_Multi( gentity_t *self, gentity_t *other, trace_t *trace )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( self->spawnflags & 4 )
|
if ( self->spawnflags & 4 )
|
||||||
{//USE_BUTTON
|
{//USE_BUTTON
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue