Place new code under MOBILE_HACKS macro.

This commit is contained in:
Andrey Akhmichin 2019-12-01 19:33:34 +05:00
parent bfe422bf2f
commit 01d12d88f5
2 changed files with 14 additions and 2 deletions

View File

@ -1692,6 +1692,7 @@ enum squeak_e
SQUEAK_THROW SQUEAK_THROW
}; };
#ifdef MOBILE_HACKS
enum toad_e { enum toad_e {
TOAD_IDLE1 = 0, TOAD_IDLE1 = 0,
TOAD_IDLE2, TOAD_IDLE2,
@ -1701,6 +1702,7 @@ enum toad_e {
TOAD_UP, TOAD_UP,
TOAD_THROW TOAD_THROW
}; };
#endif // MOBILE_HACKS
#define VEC_HULL_MIN Vector( -16, -16, -36 ) #define VEC_HULL_MIN Vector( -16, -16, -36 )
#define VEC_DUCK_HULL_MIN Vector( -16, -16, -18 ) #define VEC_DUCK_HULL_MIN Vector( -16, -16, -18 )
@ -1734,9 +1736,11 @@ void EV_SnarkFire( event_args_t *args )
//Find space to drop the thing. //Find space to drop the thing.
if( tr.allsolid == 0 && tr.startsolid == 0 && tr.fraction > 0.25f ) if( tr.allsolid == 0 && tr.startsolid == 0 && tr.fraction > 0.25f )
{ {
#ifdef MOBILE_HACKS
if( g_iModType == MOD_HALFSECRET ) if( g_iModType == MOD_HALFSECRET )
gEngfuncs.pEventAPI->EV_WeaponAnimation( TOAD_THROW, 0 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( TOAD_THROW, 0 );
else else
#endif // MOBILE_HACKS
gEngfuncs.pEventAPI->EV_WeaponAnimation( SQUEAK_THROW, 0 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( SQUEAK_THROW, 0 );
} }

View File

@ -42,6 +42,7 @@ enum squeak_e
SQUEAK_THROW SQUEAK_THROW
}; };
#ifdef MOBILE_HACKS
enum toad_e { enum toad_e {
TOAD_IDLE1 = 0, TOAD_IDLE1 = 0,
TOAD_IDLE2, TOAD_IDLE2,
@ -51,6 +52,7 @@ enum toad_e {
TOAD_UP, TOAD_UP,
TOAD_THROW TOAD_THROW
}; };
#endif // MOBILE_HACKS
#ifndef CLIENT_DLL #ifndef CLIENT_DLL
class CSqueakGrenade : public CGrenade class CSqueakGrenade : public CGrenade
@ -489,10 +491,12 @@ void CSqueak::Holster( int skiplocal /* = 0 */ )
return; return;
} }
#ifdef MOBILE_HACKS
if( g_iModType == MOD_HALFSECRET ) if( g_iModType == MOD_HALFSECRET )
SendWeaponAnim( SQUEAK_DOWN );
else
SendWeaponAnim( TOAD_DOWN ); SendWeaponAnim( TOAD_DOWN );
else
#endif // MOBILE_HACKS
SendWeaponAnim( SQUEAK_DOWN );
EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0f, ATTN_NORM ); EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0f, ATTN_NORM );
} }
@ -571,9 +575,11 @@ void CSqueak::WeaponIdle( void )
return; return;
} }
#ifdef MOBILE_HACKS
if( g_iModType == MOD_HALFSECRET ) if( g_iModType == MOD_HALFSECRET )
SendWeaponAnim( TOAD_UP ); SendWeaponAnim( TOAD_UP );
else else
#endif
SendWeaponAnim( SQUEAK_UP ); SendWeaponAnim( SQUEAK_UP );
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
return; return;
@ -581,6 +587,7 @@ void CSqueak::WeaponIdle( void )
int iAnim; int iAnim;
float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 );
#ifdef MOBILE_HACKS
if( g_iModType == MOD_HALFSECRET ) if( g_iModType == MOD_HALFSECRET )
{ {
if( flRand <= 0.625f ) if( flRand <= 0.625f )
@ -605,6 +612,7 @@ void CSqueak::WeaponIdle( void )
} }
} }
else else
#endif // MOBILE_HACKS
{ {
if( flRand <= 0.75f ) if( flRand <= 0.75f )
{ {