Do not check angle on non-facing triggers

This commit is contained in:
Petr Bartos 2023-03-30 19:26:36 +02:00
parent 402277e717
commit 15d932c75f
2 changed files with 8 additions and 8 deletions

View File

@ -1385,10 +1385,10 @@ void G_TouchTriggersWithHand( gentity_t *ent, vec3_t src, vec3_t vf ) {
continue; continue;
} }
// In case touching button-like entity via use gesture, check activation angle here. // In case touching entity requiring to be activated facing to it via use gesture, check
// Existing check in g_trigger.cpp Touch_Multi is problematic because we do not have // activation angle here. Existing check in g_trigger.cpp Touch_Multi is problematic because
// there information by which hand was entity triggered. // we do not have there information by which hand was entity triggered.
if ( DotProduct( hit->movedir, vf ) < 0.5 ) { if ( (hit->spawnflags & 2) && DotProduct( hit->movedir, vf ) < 0.5 ) {
//Not Within 45 degrees //Not Within 45 degrees
continue; continue;
} }

View File

@ -856,10 +856,10 @@ void G_TouchTriggersWithHand( gentity_t *ent, vec3_t src, vec3_t vf ) {
continue; continue;
} }
// In case touching button-like entity via use gesture, check activation angle here. // In case touching entity requiring to be activated facing to it via use gesture, check
// Existing check in g_trigger.cpp Touch_Multi is problematic because we do not have // activation angle here. Existing check in g_trigger.cpp Touch_Multi is problematic because
// there information by which hand was entity triggered. // we do not have there information by which hand was entity triggered.
if ( DotProduct( hit->movedir, vf ) < 0.5 ) { if ( (hit->spawnflags & 2) && DotProduct( hit->movedir, vf ) < 0.5 ) {
//Not Within 45 degrees //Not Within 45 degrees
continue; continue;
} }