Browse Source

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

hl_urbicide
Andrey Akhmichin 4 years ago
parent
commit
47c13ef873
  1. 2
      dlls/basemonster.h
  2. 2
      dlls/game.cpp
  3. 1
      dlls/game.h
  4. 18
      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. CBaseEntity* DropItem( const char *pszItemName, const Vector &vecPos, const Vector &vecAng );// drop an item.
#ifdef MONSTER_YAWSPEED_FIX
float m_flLastYawTime; float m_flLastYawTime;
#endif
}; };
#endif // BASEMONSTER_H #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 selfgauss = { "mp_selfgauss", "1", FCVAR_SERVER };
cvar_t chargerfix = { "mp_chargerfix", "0", FCVAR_SERVER }; cvar_t chargerfix = { "mp_chargerfix", "0", FCVAR_SERVER };
cvar_t satchelfix = { "mp_satchelfix", "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 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 };
@ -482,6 +483,7 @@ void GameDLLInit( void )
CVAR_REGISTER( &selfgauss ); CVAR_REGISTER( &selfgauss );
CVAR_REGISTER( &chargerfix ); CVAR_REGISTER( &chargerfix );
CVAR_REGISTER( &satchelfix ); CVAR_REGISTER( &satchelfix );
CVAR_REGISTER( &monsteryawspeedfix );
CVAR_REGISTER( &forcerespawn ); CVAR_REGISTER( &forcerespawn );
CVAR_REGISTER( &flashlight ); CVAR_REGISTER( &flashlight );
CVAR_REGISTER( &aimcrosshair ); CVAR_REGISTER( &aimcrosshair );

1
dlls/game.h

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

18
dlls/monsters.cpp

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

1
wscript

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

Loading…
Cancel
Save