Don't trigger haptics when blade hits solid if saber is in flight

This commit is contained in:
Simon 2023-07-12 16:33:15 +01:00
parent 19be309f9a
commit b4596caab9
2 changed files with 24 additions and 12 deletions

View file

@ -6504,10 +6504,13 @@ Ghoul2 Insert End
{
if ( !noMarks )
{
int position = (vr->right_handed ?
((saberNum == 0) ? 2 : 1) :
((saberNum == 0) ? 1 : 2));
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
if (saberNum == 1 || !cent->gent->client->ps.saberInFlight)
{
int position = (vr->right_handed ?
((saberNum == 0) ? 2 : 1) :
((saberNum == 0) ? 1 : 2));
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
}
/*
if ( !(cent->gent->client->ps.saberEventFlags&SEF_INWATER) )
@ -6534,10 +6537,13 @@ Ghoul2 Insert End
{
if ( !noMarks )
{
int position = (vr->right_handed ?
((saberNum == 0) ? 2 : 1) :
((saberNum == 0) ? 1 : 2));
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
if (saberNum == 1 || !cent->gent->client->ps.saberInFlight)
{
int position = (vr->right_handed ?
((saberNum == 0) ? 2 : 1) :
((saberNum == 0) ? 1 : 2));
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
}
if ( ( !WP_SaberBladeUseSecondBladeStyle( &client->ps.saber[saberNum], bladeNum ) && !(client->ps.saber[saberNum].saberFlags2&SFL2_NO_WALL_MARKS) )
|| ( WP_SaberBladeUseSecondBladeStyle( &client->ps.saber[saberNum], bladeNum ) && !(client->ps.saber[saberNum].saberFlags2&SFL2_NO_WALL_MARKS2) ) )

View file

@ -4588,8 +4588,11 @@ Ghoul2 Insert End
{
if ( (trace.contents&CONTENTS_WATER) || (trace.contents&CONTENTS_SLIME) )
{
int position = (vr->right_handed ? 2 : 1);
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
if (!cent->gent->client->ps.saberInFlight)
{
int position = (vr->right_handed ? 2 : 1);
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
}
/*
if ( !(cent->gent->client->ps.saberEventFlags&SEF_INWATER) )
@ -4610,8 +4613,11 @@ Ghoul2 Insert End
}
else
{
int position = (vr->right_handed ? 2 : 1);
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
if (!cent->gent->client->ps.saberInFlight)
{
int position = (vr->right_handed ? 2 : 1);
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
}
theFxScheduler.PlayEffect( "spark", trace.endpos, trace.plane.normal );
// All I need is a bool to mark whether I have a previous point to work with.