Browse Source

Merge branch 'master' into mobile_hacks

mobile_hacks
Andrey Akhmichin 1 year ago
parent
commit
80eac27f38
  1. 2
      README.md
  2. 25
      dlls/hornetgun.cpp
  3. 7
      dlls/mp5.cpp
  4. 3
      dlls/weapons.h

2
README.md

@ -80,7 +80,7 @@ git clone --recursive https://github.com/FWGS/hlsdk-portable
### Prerequisites ### Prerequisites
Install and run [Visual Studio Installer](https://visualstudio.microsoft.com/downloads/). The installer allows you to choose specific components. Select `Desktop development with C++`. You can untick everything you don't need in Installation details, but you must keep `MSVC` ticked. You may also keep `C++ CMake tools for Windows` ticked as you'll need **cmake**. Alternatively you can install **cmake** from the [cmake.org](https://cmake.org/download/) and during installation tick *Add to the PATH...*. Install and run [Visual Studio Installer](https://visualstudio.microsoft.com/downloads/). The installer allows you to choose specific components. Select `Desktop development with C++`. You can untick everything you don't need in Installation details, but you must keep `MSVC` and corresponding Windows SDK (e.g. Windows 10 SDK or Windows 11 SDK) ticked. You may also keep `C++ CMake tools for Windows` ticked as you'll need **cmake**. Alternatively you can install **cmake** from the [cmake.org](https://cmake.org/download/) and during installation tick *Add to the PATH...*.
### Opening command prompt ### Opening command prompt

25
dlls/hornetgun.cpp

@ -137,7 +137,12 @@ void CHgun::PrimaryAttack()
CBaseEntity *pHornet = CBaseEntity::Create( "hornet", m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16.0f + gpGlobals->v_right * 8.0f + gpGlobals->v_up * -12.0f, m_pPlayer->pev->v_angle, m_pPlayer->edict() ); CBaseEntity *pHornet = CBaseEntity::Create( "hornet", m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16.0f + gpGlobals->v_right * 8.0f + gpGlobals->v_up * -12.0f, m_pPlayer->pev->v_angle, m_pPlayer->edict() );
pHornet->pev->velocity = gpGlobals->v_forward * 300.0f; pHornet->pev->velocity = gpGlobals->v_forward * 300.0f;
m_flRechargeTime = gpGlobals->time + 0.5f; float flRechargeTimePause = 0.5f;
if( g_pGameRules->IsMultiplayer() )
flRechargeTimePause = 0.3f;
m_flRechargeTime = gpGlobals->time + flRechargeTimePause;
#endif #endif
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;
@ -223,8 +228,14 @@ void CHgun::SecondaryAttack( void )
pHornet->SetThink( &CHornet::StartDart ); pHornet->SetThink( &CHornet::StartDart );
m_flRechargeTime = gpGlobals->time + 0.5f; float flRechargeTimePause = 0.5f;
if( g_pGameRules->IsMultiplayer() )
flRechargeTimePause = 0.3f;
m_flRechargeTime = gpGlobals->time + flRechargeTimePause;
#endif #endif
int flags; int flags;
#if CLIENT_WEAPONS #if CLIENT_WEAPONS
flags = FEV_NOTHOST; flags = FEV_NOTHOST;
@ -251,8 +262,16 @@ void CHgun::Reload( void )
while( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] < HORNET_MAX_CARRY && m_flRechargeTime < gpGlobals->time ) while( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] < HORNET_MAX_CARRY && m_flRechargeTime < gpGlobals->time )
{ {
float flRechargeTimePause = 0.5f;
#if CLIENT_DLL
if( bIsMultiplayer() )
#else
if( g_pGameRules->IsMultiplayer() )
#endif
flRechargeTimePause = 0.3f;
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]++; m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]++;
m_flRechargeTime += 0.3f; m_flRechargeTime += flRechargeTimePause;
} }
} }

7
dlls/mp5.cpp

@ -54,6 +54,13 @@ void CMP5::Spawn()
m_iDefaultAmmo = MP5_DEFAULT_GIVE; m_iDefaultAmmo = MP5_DEFAULT_GIVE;
#if CLIENT_DLL
if( bIsMultiplayer() )
#else
if( g_pGameRules->IsMultiplayer() )
#endif
m_iDefaultAmmo = MP5_DEFAULT_GIVE_MP;
FallInit();// get ready to fall down. FallInit();// get ready to fall down.
} }

3
dlls/weapons.h

@ -144,7 +144,8 @@ public:
#define GLOCK_DEFAULT_GIVE 17 #define GLOCK_DEFAULT_GIVE 17
#define BIGLOLLY_GLOCK_DEFAULT_GIVE 30 #define BIGLOLLY_GLOCK_DEFAULT_GIVE 30
#define PYTHON_DEFAULT_GIVE 6 #define PYTHON_DEFAULT_GIVE 6
#define MP5_DEFAULT_GIVE 50 #define MP5_DEFAULT_GIVE 25
#define MP5_DEFAULT_GIVE_MP MP5_MAX_CLIP
#define MP5_M203_DEFAULT_GIVE 0 #define MP5_M203_DEFAULT_GIVE 0
#define SHOTGUN_DEFAULT_GIVE 12 #define SHOTGUN_DEFAULT_GIVE 12
#define CROSSBOW_DEFAULT_GIVE 5 #define CROSSBOW_DEFAULT_GIVE 5

Loading…
Cancel
Save