2121#include 	" extdll.h" 
2222#include 	" util.h" 
2323#include 	" cbase.h" 
24+ #include         " game.h" 
2425#include 	" monsters.h" 
2526#include 	" schedule.h" 
2627#include 	" flyingmonster.h" 
@@ -76,7 +77,7 @@ class CIchthyosaur : public CFlyingMonster
7677	BOOL CheckMeleeAttack1 ( float  flDot, float  flDist );
7778	BOOL CheckRangeAttack1 ( float  flDot, float  flDist );
7879
79- 	float  ChangeYaw ( int  speed  );
80+ 	float  ChangeYaw ( int  yawSpeed  );
8081	Activity GetStoppedActivity ( void  );
8182
8283	void  Move ( float  flInterval );
@@ -88,7 +89,7 @@ class CIchthyosaur : public CFlyingMonster
8889
8990	float  VectorToPitch ( const  Vector &vec );
9091	float  FlPitchDiff ( void  );
91- 	float  ChangePitch ( int  speed  );
92+ 	float  ChangePitch ( int  pitchSpeed  );
9293
9394	virtual  int  SizeForGrapple () { return  GRAPPLE_LARGE; }
9495
@@ -108,6 +109,9 @@ class CIchthyosaur : public CFlyingMonster
108109
109110	float  m_flNextAlert;
110111
112+ 	float  m_flLastPitchTime;	//  Last frame time pitch was changed
113+ 	float  m_flLastZYawTime;		//  Last frame time Z was changed when yaw was changed
114+ 
111115	static  const  char  *pIdleSounds[];
112116	static  const  char  *pAlertSounds[];
113117	static  const  char  *pAttackSounds[];
@@ -782,7 +786,7 @@ float CIchthyosaur::FlPitchDiff( void )
782786	return  flPitchDiff;
783787}
784788
785- float  CIchthyosaur::ChangePitch ( int  speed  )
789+ float  CIchthyosaur::ChangePitch ( int  pitchSpeed  )
786790{
787791	if ( pev->movetype  == MOVETYPE_FLY )
788792	{
@@ -795,12 +799,28 @@ float CIchthyosaur::ChangePitch( int speed )
795799			else  if ( diff > 20  )
796800				target = -45 ;
797801		}
798- 		pev->angles .x  = UTIL_Approach (target, pev->angles .x , 220 .0f  * 0 .1f  );
802+ 
803+ 		float  speed = 220 .f ;
804+ 
805+                 if ( monsteryawspeedfix.value  )
806+                 {
807+                         if ( m_flLastPitchTime == 0 .f  )
808+                                 m_flLastPitchTime = gpGlobals->time  - gpGlobals->frametime ;
809+ 
810+                         float  delta = Q_min ( gpGlobals->time  - m_flLastPitchTime, 0 .25f  );
811+                         m_flLastPitchTime = gpGlobals->time ;
812+ 
813+                         speed *= delta;
814+                 }
815+                 else 
816+                         speed *= 0 .1f ;
817+ 
818+ 		pev->angles .x  = UTIL_Approach (target, pev->angles .x , speed );
799819	}
800820	return  0 ;
801821}
802822
803- float  CIchthyosaur::ChangeYaw ( int  speed  )
823+ float  CIchthyosaur::ChangeYaw ( int  yawSpeed  )
804824{
805825	if ( pev->movetype  == MOVETYPE_FLY )
806826	{
@@ -814,9 +834,25 @@ float CIchthyosaur::ChangeYaw( int speed )
814834			else  if ( diff > 20  )
815835				target = -20 ;
816836		}
817- 		pev->angles .z  = UTIL_Approach ( target, pev->angles .z , 220 .0f  * 0 .1f  );
837+ 
838+ 		float  speed = 220 .f ;
839+ 
840+                 if ( monsteryawspeedfix.value  )
841+                 {
842+                         if ( m_flLastZYawTime == 0 .f  )
843+                                 m_flLastZYawTime = gpGlobals->time  - gpGlobals->frametime ;
844+ 
845+                         float  delta = Q_min ( gpGlobals->time  - m_flLastZYawTime, 0 .25f  );
846+                         m_flLastZYawTime = gpGlobals->time ;
847+ 
848+                         speed *= delta;
849+                 }
850+                 else 
851+                         speed *= 0 .1f ;
852+ 
853+ 		pev->angles .z  = UTIL_Approach ( target, pev->angles .z , speed );
818854	}
819- 	return  CFlyingMonster::ChangeYaw ( speed  );
855+ 	return  CFlyingMonster::ChangeYaw ( yawSpeed  );
820856}
821857
822858Activity CIchthyosaur::GetStoppedActivity ( void  )
0 commit comments