Fix insta-death on elevator situation

seems gesture use was triggering the "hurt_touch" function of the elevator entity which was inflicting 10000 fall damage to the player!
This commit is contained in:
Simon 2023-05-09 22:49:33 +01:00
parent 4405c2214f
commit a7318c2d89

View file

@ -1403,7 +1403,9 @@ void G_TouchTriggersWithHand( bool offHand, gentity_t *ent, vec3_t src, vec3_t v
touched[i] = qtrue;
memset( &trace, 0, sizeof(trace) );
if ( hit->e_TouchFunc != touchF_NULL ) {
if ( hit->e_TouchFunc != touchF_NULL &&
hit->e_TouchFunc != touchF_hurt_touch) //We don't want the use gesture to trigger a hurt function!
{
int channel = vr->right_handed != offHand ? 1 : 2;
if (level.time > vr->useHapticFeedbackTime[channel - 1]) {
cgi_HapticEvent("use_button", 0, channel, 60, 0, 0);