mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-25 22:24:16 +00:00
Add a cvar fixing pushable excessive acceleration (#343)
This commit is contained in:
parent
813aa0ae91
commit
1c80e4bbcd
@ -26,6 +26,7 @@
|
|||||||
#include "func_break.h"
|
#include "func_break.h"
|
||||||
#include "decals.h"
|
#include "decals.h"
|
||||||
#include "explode.h"
|
#include "explode.h"
|
||||||
|
#include "game.h"
|
||||||
|
|
||||||
extern DLL_GLOBAL Vector g_vecAttackDir;
|
extern DLL_GLOBAL Vector g_vecAttackDir;
|
||||||
|
|
||||||
@ -925,12 +926,24 @@ void CPushable::Move( CBaseEntity *pOther, int push )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// g-cont. fix pushable acceleration bug (reverted as it used in mods)
|
|
||||||
if( pOther->IsPlayer() )
|
if( pOther->IsPlayer() )
|
||||||
{
|
{
|
||||||
// Don't push unless the player is pushing forward and NOT use (pull)
|
// g-cont. fix pushable acceleration bug (now implemented as cvar)
|
||||||
if( push && !( pevToucher->button & ( IN_FORWARD | IN_USE ) ) )
|
if (pushablemode.value == 1)
|
||||||
return;
|
{
|
||||||
|
// Allow player push when moving right, left and back too
|
||||||
|
if ( push && !(pevToucher->button & (IN_FORWARD|IN_MOVERIGHT|IN_MOVELEFT|IN_BACK)) )
|
||||||
|
return;
|
||||||
|
// Require player walking back when applying '+use' on pushable
|
||||||
|
if ( !push && !(pevToucher->button & (IN_BACK)) )
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Don't push unless the player is pushing forward and NOT use (pull)
|
||||||
|
if( push && !( pevToucher->button & ( IN_FORWARD | IN_USE ) ) )
|
||||||
|
return;
|
||||||
|
}
|
||||||
playerTouch = 1;
|
playerTouch = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -951,6 +964,13 @@ void CPushable::Move( CBaseEntity *pOther, int push )
|
|||||||
else
|
else
|
||||||
factor = 0.25f;
|
factor = 0.25f;
|
||||||
|
|
||||||
|
// Spirit fix for pushable acceleration
|
||||||
|
if (pushablemode.value == 2)
|
||||||
|
{
|
||||||
|
if (!push)
|
||||||
|
factor *= 0.5f;
|
||||||
|
}
|
||||||
|
|
||||||
pev->velocity.x += pevToucher->velocity.x * factor;
|
pev->velocity.x += pevToucher->velocity.x * factor;
|
||||||
pev->velocity.y += pevToucher->velocity.y * factor;
|
pev->velocity.y += pevToucher->velocity.y * factor;
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ cvar_t satchelfix = { "satchelfix", "0", FCVAR_SERVER };
|
|||||||
cvar_t explosionfix = { "explosionfix", "0", FCVAR_SERVER };
|
cvar_t explosionfix = { "explosionfix", "0", FCVAR_SERVER };
|
||||||
cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "1", FCVAR_SERVER };
|
cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "1", FCVAR_SERVER };
|
||||||
cvar_t corpsephysics = { "corpsephysics", "0", FCVAR_SERVER };
|
cvar_t corpsephysics = { "corpsephysics", "0", FCVAR_SERVER };
|
||||||
|
cvar_t pushablemode = { "pushablemode", "0", FCVAR_SERVER };
|
||||||
cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER };
|
cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER };
|
||||||
cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER };
|
cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER };
|
||||||
cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER };
|
cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER };
|
||||||
@ -491,6 +492,7 @@ void GameDLLInit( void )
|
|||||||
CVAR_REGISTER( &explosionfix );
|
CVAR_REGISTER( &explosionfix );
|
||||||
CVAR_REGISTER( &monsteryawspeedfix );
|
CVAR_REGISTER( &monsteryawspeedfix );
|
||||||
CVAR_REGISTER( &corpsephysics );
|
CVAR_REGISTER( &corpsephysics );
|
||||||
|
CVAR_REGISTER( &pushablemode );
|
||||||
CVAR_REGISTER( &forcerespawn );
|
CVAR_REGISTER( &forcerespawn );
|
||||||
CVAR_REGISTER( &flashlight );
|
CVAR_REGISTER( &flashlight );
|
||||||
CVAR_REGISTER( &aimcrosshair );
|
CVAR_REGISTER( &aimcrosshair );
|
||||||
|
@ -33,6 +33,7 @@ extern cvar_t satchelfix;
|
|||||||
extern cvar_t explosionfix;
|
extern cvar_t explosionfix;
|
||||||
extern cvar_t monsteryawspeedfix;
|
extern cvar_t monsteryawspeedfix;
|
||||||
extern cvar_t corpsephysics;
|
extern cvar_t corpsephysics;
|
||||||
|
extern cvar_t pushablemode;
|
||||||
extern cvar_t forcerespawn;
|
extern cvar_t forcerespawn;
|
||||||
extern cvar_t flashlight;
|
extern cvar_t flashlight;
|
||||||
extern cvar_t aimcrosshair;
|
extern cvar_t aimcrosshair;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user