mirror of
https://github.com/FWGS/hlsdk-xash3d
synced 2024-11-22 01:47:45 +01:00
server: fix monster yaw speed (#137)
This makes the yaw speed for all monsters (scientists, headcrabs, etc.) framerate independent. Fix by Solokiller with mikela-valve's adjustments: https://github.com/ValveSoftware/halflife/issues/2458
This commit is contained in:
parent
dbd9b1c698
commit
4be53d8527
@ -328,5 +328,9 @@ public:
|
||||
BOOL CineCleanup();
|
||||
|
||||
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
|
||||
|
@ -2022,6 +2022,10 @@ void CBaseMonster::MonsterInit( void )
|
||||
SetThink( &CBaseMonster::MonsterInitThink );
|
||||
pev->nextthink = gpGlobals->time + 0.1f;
|
||||
SetUse( &CBaseMonster::MonsterUse );
|
||||
|
||||
#ifdef MONSTER_YAWSPEED_FIX
|
||||
m_flLastYawTime = gpGlobals->time;
|
||||
#endif
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
@ -2504,7 +2508,15 @@ 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;
|
||||
|
||||
speed = (float)yawSpeed * delta * 2;
|
||||
#else
|
||||
speed = (float)yawSpeed * gpGlobals->frametime * 10;
|
||||
#endif
|
||||
move = ideal - current;
|
||||
|
||||
if( ideal > current )
|
||||
@ -2548,6 +2560,10 @@ float CBaseMonster::ChangeYaw( int yawSpeed )
|
||||
else
|
||||
move = 0;
|
||||
|
||||
#ifdef MONSTER_YAWSPEED_FIX
|
||||
m_flLastYawTime = gpGlobals->time;
|
||||
#endif
|
||||
|
||||
return move;
|
||||
}
|
||||
|
||||
|
1
wscript
1
wscript
@ -275,6 +275,7 @@ 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…
Reference in New Issue
Block a user