Browse Source

server: Use separate cvar instead of macro for monster yaw speed fix.

pull/143/head
Andrey Akhmichin 2 years ago
parent
commit
47c13ef873
  1. 2
      dlls/basemonster.h
  2. 2
      dlls/game.cpp
  3. 1
      dlls/game.h
  4. 22
      dlls/monsters.cpp
  5. 1
      wscript

2
dlls/basemonster.h

@ -329,8 +329,6 @@ public:
CBaseEntity* DropItem( const char *pszItemName, const Vector &vecPos, const Vector &vecAng );// drop an item.
#ifdef MONSTER_YAWSPEED_FIX
float m_flLastYawTime;
#endif
};
#endif // BASEMONSTER_H

2
dlls/game.cpp

@ -35,6 +35,7 @@ cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER };
cvar_t selfgauss = { "mp_selfgauss", "1", FCVAR_SERVER };
cvar_t chargerfix = { "mp_chargerfix", "0", FCVAR_SERVER };
cvar_t satchelfix = { "mp_satchelfix", "0", FCVAR_SERVER };
cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "0", FCVAR_SERVER };
cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER };
cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER };
cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER };
@ -482,6 +483,7 @@ void GameDLLInit( void )
CVAR_REGISTER( &selfgauss );
CVAR_REGISTER( &chargerfix );
CVAR_REGISTER( &satchelfix );
CVAR_REGISTER( &monsteryawspeedfix );
CVAR_REGISTER( &forcerespawn );
CVAR_REGISTER( &flashlight );
CVAR_REGISTER( &aimcrosshair );

1
dlls/game.h

@ -30,6 +30,7 @@ extern cvar_t weaponstay;
extern cvar_t selfgauss;
extern cvar_t chargerfix;
extern cvar_t satchelfix;
extern cvar_t monsteryawspeedfix;
extern cvar_t forcerespawn;
extern cvar_t flashlight;
extern cvar_t aimcrosshair;

22
dlls/monsters.cpp

@ -2023,9 +2023,7 @@ void CBaseMonster::MonsterInit( void )
pev->nextthink = gpGlobals->time + 0.1f;
SetUse( &CBaseMonster::MonsterUse );
#ifdef MONSTER_YAWSPEED_FIX
m_flLastYawTime = gpGlobals->time;
#endif
}
//=========================================================
@ -2508,15 +2506,17 @@ float CBaseMonster::ChangeYaw( int yawSpeed )
ideal = pev->ideal_yaw;
if( current != ideal )
{
#ifdef MONSTER_YAWSPEED_FIX
float delta = gpGlobals->time - m_flLastYawTime;
if( delta > 0.25 )
delta = 0.25;
if( monsteryawspeedfix.value )
{
float delta;
delta = Q_min( gpGlobals->time - m_flLastYawTime, 0.25f );
speed = (float)yawSpeed * delta * 2;
}
else
speed = (float)yawSpeed * gpGlobals->frametime * 10;
speed = (float)yawSpeed * delta * 2;
#else
speed = (float)yawSpeed * gpGlobals->frametime * 10;
#endif
move = ideal - current;
if( ideal > current )
@ -2560,9 +2560,7 @@ float CBaseMonster::ChangeYaw( int yawSpeed )
else
move = 0;
#ifdef MONSTER_YAWSPEED_FIX
m_flLastYawTime = gpGlobals->time;
#endif
return move;
}

1
wscript

@ -275,7 +275,6 @@ def configure(conf):
conf.define('CROWBAR_DELAY_FIX', False)
conf.define('CROWBAR_FIX_RAPID_CROWBAR', False)
conf.define('GAUSS_OVERCHARGE_FIX', False)
conf.define('MONSTER_YAWSPEED_FIX', False)
if conf.env.DEST_OS == 'android' or conf.options.ENABLE_MOD_HACKS:
conf.define('MOBILE_HACKS', '1')

Loading…
Cancel
Save