diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8547b3b6..64cd3d3d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: C/C++ CI on: push: - branches: [master] + branches: [master, nostalgia] paths-ignore: - '**.md' diff --git a/README.md b/README.md index 93cd795d2..fb9088f09 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,9 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_give_c4_frags | 3 | - | - | How many bonuses (frags) will get the player who defused or exploded the bomb. | | mp_hostages_rescued_ratio | 1.0 | 0.0 | 1.0 | Ratio of hostages rescued to win the round. | | mp_legacy_vehicle_block | 1 | 0 | 1 | Legacy func_vehicle behavior when blocked by another entity.
`0` New behavior
`1` Legacy behavior | +| mp_max_alive_name_changes | -1 | -1 | - | Maximum amount of nickname changes when alive
`-1` unlimited
`0` Blocks name changes
`>0` Allow to change arbitrary amount of nicks | +| sv_legacy_restart_entities | 0 | 0 | 1 | Legacy restart of entities on new round
`0` disabled
`1` enabled | +| sv_block_vote_commands | 0 | 0 | 1 | When set, blocks `vote` and `votemap` commands.
`0` disabled
`1` enabled | | mp_dying_time | 3.0 | 0.0 | - | Time for switch to free observing after death.
`0` - disable spectating around death.
`>0.00001` - time delay to start spectate.
`NOTE`: The countdown starts when the player’s death animation is finished. | | mp_deathmsg_flags | abc | 0 | - | Sets a flags for extra information in the player's death message.
`0` disabled
`a` position where the victim died
`b` index of the assistant who helped the attacker kill the victim
`c` rarity classification bits, e.g., `blinkill`, `noscope`, `penetrated`, etc. | | mp_assist_damage_threshold | 40 | 0 | 100 | Sets the percentage of damage needed to score an assist. | diff --git a/dist/game.cfg b/dist/game.cfg index 91009dd00..d41e685b2 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -529,6 +529,27 @@ mp_hostages_rescued_ratio "1.0" // // Default value: "1" mp_legacy_vehicle_block "1" +// Maximum amount of nickname changes before next respawn. +// -1 - unlimited (default behaviour) +// 0 - Blocks name changes +// >0 - Allow to change arbitrary amount of nicks +// +// Default value: "-1" +mp_max_alive_name_changes -1 + +// Legacy restart of entities on new round. +// 0 - disabled (default behaviour) +// 1 - enabled +// +// Default value: "0" +sv_legacy_restart_entities 0 + +// When set, blocks "vote" and "votemap" commands. +// 0 - disabled (default behaviour) +// 1 - enabled +// +// Default value: "0" +sv_block_vote_commands 0 // Time for switch to free observing after death. // NOTE: The countdown starts when the player’s death animation is finished. diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 5bb6b3940..e3edbafcc 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -173,6 +173,7 @@ ReGameFuncs_t g_ReGameApiFuncs = { UTIL_Remove_api, AddAmmoNameToAmmoRegistry_api, + RemoveAmmoNameFromAmmoRegistry, TextureTypePlaySound_api, CreateWeaponBox_api, SpawnGrenade_api, diff --git a/regamedll/dlls/API/CSPlayer.cpp b/regamedll/dlls/API/CSPlayer.cpp index 57bf10d1c..23c94ec21 100644 --- a/regamedll/dlls/API/CSPlayer.cpp +++ b/regamedll/dlls/API/CSPlayer.cpp @@ -544,6 +544,7 @@ void CCSPlayer::ResetVars() m_bGameForcingRespawn = false; m_bAutoBunnyHopping = false; m_bMegaBunnyJumping = false; + m_iAliveNameChanges = 0; m_bSpawnProtectionEffects = false; } @@ -564,6 +565,7 @@ void CCSPlayer::OnSpawn() { m_bGameForcingRespawn = false; m_flRespawnPending = 0.0f; + m_iAliveNameChanges = 0; m_DamageList.Clear(); } diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index 70c8a426c..7aa20ebee 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -2590,7 +2590,11 @@ void EXT_FUNC InternalCommand(edict_t *pEntity, const char *pcmd, const char *pa pPlayer->ForceClientDllUpdate(); } } - else if (FStrEq(pcmd, "vote")) + else if (FStrEq(pcmd, "vote") +#ifdef REGAMEDLL_ADD + && sv_block_vote_commands.value <= 0 +#endif + ) { if (gpGlobals->time >= pPlayer->m_flLastCommandTime[CMD_VOTE]) { @@ -2671,7 +2675,11 @@ void EXT_FUNC InternalCommand(edict_t *pEntity, const char *pcmd, const char *pa CSGameRules()->DisplayMaps(pPlayer, 0); } } - else if (FStrEq(pcmd, "votemap")) + else if (FStrEq(pcmd, "votemap") +#ifdef REGAMEDLL_ADD + && sv_block_vote_commands.value <= 0 +#endif + ) { if (gpGlobals->time >= pPlayer->m_flLastCommandTime[CMD_VOTEMAP]) { diff --git a/regamedll/dlls/client.h b/regamedll/dlls/client.h index d873bd202..68586b2a4 100644 --- a/regamedll/dlls/client.h +++ b/regamedll/dlls/client.h @@ -54,6 +54,13 @@ enum BuyItemMenuSlot MENU_SLOT_ITEM_SHIELD, }; +// custom enum +enum +{ + BLOCK_VOTE = BIT(0), + BLOCK_VOTEMAP = BIT(1), +}; + #define CS_NUM_SKIN 4 #define CZ_NUM_SKIN 5 diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 4ab375d8b..22dbfb715 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -171,8 +171,11 @@ cvar_t deathmsg_flags = { "mp_deathmsg_flags", "abc", 0, 0.0f cvar_t assist_damage_threshold = { "mp_assist_damage_threshold", "40", 0, 40.0f, nullptr }; cvar_t freezetime_duck = { "mp_freezetime_duck", "1", 0, 1.0f, nullptr }; cvar_t freezetime_jump = { "mp_freezetime_jump", "1", 0, 1.0f, nullptr }; +cvar_t hostages_rescued_ratio = { "mp_hostages_rescued_ratio", "1.0", 0, 1.0f, nullptr }; -cvar_t hostages_rescued_ratio = { "mp_hostages_rescued_ratio", "1.0", 0, 1.0f, nullptr }; +cvar_t max_alive_name_changes = { "mp_max_alive_name_changes", "-1", 0, -1.0f, nullptr }; +cvar_t legacy_restart_entities = { "sv_legacy_restart_entities", "0", 0, 0.0f, nullptr }; +cvar_t sv_block_vote_commands = { "sv_block_vote_commands", "0", 0, 0.0f, nullptr }; cvar_t legacy_vehicle_block = { "mp_legacy_vehicle_block", "1", 0, 0.0f, nullptr }; @@ -429,9 +432,7 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&sv_enablebunnyhopping); CVAR_REGISTER(&plant_c4_anywhere); CVAR_REGISTER(&give_c4_frags); - CVAR_REGISTER(&hostages_rescued_ratio); - CVAR_REGISTER(&legacy_vehicle_block); CVAR_REGISTER(&dying_time); @@ -442,6 +443,10 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&freezetime_jump); CVAR_REGISTER(&defuser_allocation); + CVAR_REGISTER(&max_alive_name_changes); + CVAR_REGISTER(&legacy_restart_entities); + CVAR_REGISTER(&sv_block_vote_commands); + // print version CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n"); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index 706e1c2af..d48850108 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -202,6 +202,10 @@ extern cvar_t freezetime_duck; extern cvar_t freezetime_jump; extern cvar_t defuser_allocation; +extern cvar_t max_alive_name_changes; +extern cvar_t legacy_restart_entities; +extern cvar_t sv_block_vote_commands; + #endif extern cvar_t scoreboard_showmoney; diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index ec3acdb4e..398b4b1b0 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -607,11 +607,16 @@ LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, CleanUpMap) void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CleanUpMap)() { #ifdef REGAMEDLL_FIXES - UTIL_RestartOther("multi_manager"); +#ifdef REGAMEDLL_ADD + if (!(bool)legacy_restart_entities.value) +#endif + { + UTIL_RestartOther("multi_manager"); - // Release or reset everything entities in depending of flags ObjectCaps - // (FCAP_MUST_RESET / FCAP_MUST_RELEASE) - UTIL_ResetEntities(); + // Release or reset everything entities in depending of flags ObjectCaps + // (FCAP_MUST_RESET / FCAP_MUST_RELEASE) + UTIL_ResetEntities(); + } #endif // Recreate all the map entities from the map data (preserving their indices), @@ -622,11 +627,16 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CleanUpMap)() UTIL_RestartOther("func_door"); #ifdef REGAMEDLL_FIXES - UTIL_RestartOther("func_button"); - UTIL_RestartOther("func_rot_button"); - UTIL_RestartOther("env_render"); - UTIL_RestartOther("env_spark"); - UTIL_RestartOther("trigger_push"); +#ifdef REGAMEDLL_ADD + if (!(bool)legacy_restart_entities.value) +#endif + { + UTIL_RestartOther("func_button"); + UTIL_RestartOther("func_rot_button"); + UTIL_RestartOther("env_render"); + UTIL_RestartOther("env_spark"); + UTIL_RestartOther("trigger_push"); + } #endif UTIL_RestartOther("func_water"); @@ -639,15 +649,20 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CleanUpMap)() UTIL_RestartOther("env_sprite"); #ifdef REGAMEDLL_FIXES - UTIL_RestartOther("trigger_once"); - UTIL_RestartOther("func_wall_toggle"); - UTIL_RestartOther("func_healthcharger"); - UTIL_RestartOther("func_recharge"); - UTIL_RestartOther("trigger_hurt"); - UTIL_RestartOther("multisource"); - UTIL_RestartOther("env_beam"); - UTIL_RestartOther("env_laser"); - UTIL_RestartOther("trigger_auto"); +#ifdef REGAMEDLL_ADD + if (!(bool)legacy_restart_entities.value) +#endif + { + UTIL_RestartOther("trigger_once"); + UTIL_RestartOther("func_wall_toggle"); + UTIL_RestartOther("func_healthcharger"); + UTIL_RestartOther("func_recharge"); + UTIL_RestartOther("trigger_hurt"); + UTIL_RestartOther("multisource"); + UTIL_RestartOther("env_beam"); + UTIL_RestartOther("env_laser"); + UTIL_RestartOther("trigger_auto"); + } #endif // Remove grenades and C4 diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 06c550890..5df67f700 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -171,7 +171,19 @@ bool EXT_FUNC CBasePlayer::__API_HOOK(SetClientUserInfoName)(char *infobuffer, c } #endif - if (pev->deadflag != DEAD_NO) +#ifdef REGAMEDLL_ADD + if (max_alive_name_changes.value <= 0) + { + ClientPrint(pev, HUD_PRINTCENTER, "#Command_Not_Available"); + return false; + } +#endif + + if (pev->deadflag != DEAD_NO +#if defined REGAMEDLL_API && REGAMEDLL_ADD + || CSPlayer()->m_iAliveNameChanges >= max_alive_name_changes.value +#endif + ) { m_bHasChangedName = true; Q_snprintf(m_szNewName, sizeof(m_szNewName), "%s", szNewName); @@ -189,6 +201,10 @@ bool EXT_FUNC CBasePlayer::__API_HOOK(SetClientUserInfoName)(char *infobuffer, c WRITE_STRING(szNewName); MESSAGE_END(); +#ifdef REGAMEDLL_API + CSPlayer()->m_iAliveNameChanges++; +#endif + UTIL_LogPrintf("\"%s<%i><%s><%s>\" changed name to \"%s\"\n", STRING(pev->netname), GETPLAYERUSERID(edict()), GETPLAYERAUTHID(edict()), GetTeam(m_iTeam), szNewName); return true; } diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index 2c035c746..3f441975e 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -212,6 +212,28 @@ struct { { AMMO_C4, "C4" }, }; #endif +#ifdef REGAMEDLL_API +BOOL EXT_FUNC RemoveAmmoNameFromAmmoRegistry(const char *szAmmoname) +{ + if (!szAmmoname || !szAmmoname[0]) + { + return FALSE; + } + + for (int i = 1; i < MAX_AMMO_SLOTS; i++) + { + AmmoInfo& ammoinfo = CBasePlayerItem::m_AmmoInfoArray[i]; + + if (ammoinfo.iId && !Q_stricmp(ammoinfo.pszName, szAmmoname)) + { + Q_memset(&CBasePlayerItem::m_AmmoInfoArray[i], 0, sizeof(CBasePlayerItem::m_AmmoInfoArray[i])); + return TRUE; + } + } + + return FALSE; +} +#endif // Precaches the ammo and queues the ammo info for sending to clients int AddAmmoNameToAmmoRegistry(const char *szAmmoname) @@ -222,6 +244,32 @@ int AddAmmoNameToAmmoRegistry(const char *szAmmoname) return -1; } +#ifdef REGAMEDLL_ADD + int newIndex = -1; + for (int i = 1; i < MAX_AMMO_SLOTS; i++) + { + AmmoInfo& ammoinfo = CBasePlayerItem::m_AmmoInfoArray[i]; + + if (ammoinfo.iId && !Q_stricmp(ammoinfo.pszName, szAmmoname)) + { + return i; + } + + // New slot for the ammo it's the first one clear. + if (!ammoinfo.iId && newIndex == -1) + { + newIndex = i; + } + } + + if (newIndex != -1) + { + CBasePlayerItem::m_AmmoInfoArray[newIndex].pszName = szAmmoname; + CBasePlayerItem::m_AmmoInfoArray[newIndex].iId = newIndex; + } + + return newIndex; +#else // make sure it's not already in the registry for (int i = 1; i < MAX_AMMO_SLOTS; i++) { @@ -260,6 +308,7 @@ int AddAmmoNameToAmmoRegistry(const char *szAmmoname) CBasePlayerItem::m_AmmoInfoArray[giAmmoIndex].iId = giAmmoIndex; return giAmmoIndex; +#endif } // Precaches the weapon and queues the weapon info for sending to clients @@ -1228,10 +1277,9 @@ void CBasePlayerItem::AttachToPlayer(CBasePlayer *pPlayer) void CBasePlayerWeapon::Spawn() { #ifdef REGAMEDLL_API - ItemInfo info; - Q_memset(&info, 0, sizeof(info)); + ItemInfo &info = m_ItemInfoArray[m_iId]; - if (GetItemInfo(&info)) { + if (info.iId) { CSPlayerItem()->SetItemInfo(&info); } #endif diff --git a/regamedll/dlls/weapons.h b/regamedll/dlls/weapons.h index c9cd58c36..a52a1c1b7 100644 --- a/regamedll/dlls/weapons.h +++ b/regamedll/dlls/weapons.h @@ -2181,4 +2181,5 @@ float GetBaseAccuracy(WeaponIdType id); void ClearMultiDamage_OrigFunc(); void ApplyMultiDamage_OrigFunc(entvars_t *pevInflictor, entvars_t *pevAttacker); void AddMultiDamage_OrigFunc(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType); +BOOL RemoveAmmoNameFromAmmoRegistry(const char* szAmmoname); #endif diff --git a/regamedll/dlls/wpn_shared/wpn_ak47.cpp b/regamedll/dlls/wpn_shared/wpn_ak47.cpp index 1a27a3f92..1cc9efcaa 100644 --- a/regamedll/dlls/wpn_shared/wpn_ak47.cpp +++ b/regamedll/dlls/wpn_shared/wpn_ak47.cpp @@ -173,7 +173,7 @@ void CAK47::AK47Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CAK47::Reload() { -#ifdef REGAMEDLL_FIXES +#ifndef REGAMEDLL_FIXES // to prevent reload if not enough ammo if (m_pPlayer->ammo_762nato <= 0) return; diff --git a/regamedll/dlls/wpn_shared/wpn_aug.cpp b/regamedll/dlls/wpn_shared/wpn_aug.cpp index 988c74808..6150ff4a4 100644 --- a/regamedll/dlls/wpn_shared/wpn_aug.cpp +++ b/regamedll/dlls/wpn_shared/wpn_aug.cpp @@ -181,8 +181,10 @@ void CAUG::AUGFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CAUG::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_556nato <= 0) return; +#endif if (DefaultReload(iMaxClip(), AUG_RELOAD, AUG_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_awp.cpp b/regamedll/dlls/wpn_shared/wpn_awp.cpp index 0e31bd548..e86eebb13 100644 --- a/regamedll/dlls/wpn_shared/wpn_awp.cpp +++ b/regamedll/dlls/wpn_shared/wpn_awp.cpp @@ -194,8 +194,10 @@ void CAWP::AWPFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CAWP::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_338mag <= 0) return; +#endif if (DefaultReload(iMaxClip(), AWP_RELOAD, AWP_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_deagle.cpp b/regamedll/dlls/wpn_shared/wpn_deagle.cpp index 7dbed0c6b..001039e97 100644 --- a/regamedll/dlls/wpn_shared/wpn_deagle.cpp +++ b/regamedll/dlls/wpn_shared/wpn_deagle.cpp @@ -183,8 +183,10 @@ void CDEAGLE::DEAGLEFire(float flSpread, float flCycleTime, BOOL fUseSemi) void CDEAGLE::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_50ae <= 0) return; +#endif if (DefaultReload(iMaxClip(), DEAGLE_RELOAD, DEAGLE_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_elite.cpp b/regamedll/dlls/wpn_shared/wpn_elite.cpp index 05428d8ed..1a0f8a9d5 100644 --- a/regamedll/dlls/wpn_shared/wpn_elite.cpp +++ b/regamedll/dlls/wpn_shared/wpn_elite.cpp @@ -205,8 +205,10 @@ void CELITE::ELITEFire(float flSpread, float flCycleTime, BOOL fUseSemi) void CELITE::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_9mm <= 0) return; +#endif if (DefaultReload(iMaxClip(), ELITE_RELOAD, ELITE_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_famas.cpp b/regamedll/dlls/wpn_shared/wpn_famas.cpp index eb7bcc892..0c0355165 100644 --- a/regamedll/dlls/wpn_shared/wpn_famas.cpp +++ b/regamedll/dlls/wpn_shared/wpn_famas.cpp @@ -216,8 +216,10 @@ void CFamas::FamasFire(float flSpread, float flCycleTime, BOOL fUseAutoAim, BOOL void CFamas::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_556nato <= 0) return; +#endif if (DefaultReload(iMaxClip(), FAMAS_RELOAD, FAMAS_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_fiveseven.cpp b/regamedll/dlls/wpn_shared/wpn_fiveseven.cpp index 31f211f08..c57bd003a 100644 --- a/regamedll/dlls/wpn_shared/wpn_fiveseven.cpp +++ b/regamedll/dlls/wpn_shared/wpn_fiveseven.cpp @@ -182,8 +182,10 @@ void CFiveSeven::FiveSevenFire(float flSpread, float flCycleTime, BOOL fUseSemi) void CFiveSeven::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_57mm <= 0) return; +#endif if (DefaultReload(iMaxClip(), FIVESEVEN_RELOAD, FIVESEVEN_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_g3sg1.cpp b/regamedll/dlls/wpn_shared/wpn_g3sg1.cpp index 5351d0f78..d15b3b20c 100644 --- a/regamedll/dlls/wpn_shared/wpn_g3sg1.cpp +++ b/regamedll/dlls/wpn_shared/wpn_g3sg1.cpp @@ -191,8 +191,10 @@ void CG3SG1::G3SG1Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CG3SG1::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_762nato <= 0) return; +#endif if (DefaultReload(iMaxClip(), G3SG1_RELOAD, G3SG1_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_galil.cpp b/regamedll/dlls/wpn_shared/wpn_galil.cpp index 69326075e..e6f5a96cf 100644 --- a/regamedll/dlls/wpn_shared/wpn_galil.cpp +++ b/regamedll/dlls/wpn_shared/wpn_galil.cpp @@ -176,7 +176,7 @@ void CGalil::GalilFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CGalil::Reload() { -#ifdef REGAMEDLL_FIXES +#ifndef REGAMEDLL_FIXES // to prevent reload if not enough ammo if (m_pPlayer->ammo_556nato <= 0) return; diff --git a/regamedll/dlls/wpn_shared/wpn_glock18.cpp b/regamedll/dlls/wpn_shared/wpn_glock18.cpp index c2f5399d5..f505b6fa6 100644 --- a/regamedll/dlls/wpn_shared/wpn_glock18.cpp +++ b/regamedll/dlls/wpn_shared/wpn_glock18.cpp @@ -259,8 +259,10 @@ void CGLOCK18::GLOCK18Fire(float flSpread, float flCycleTime, BOOL bFireBurst) void CGLOCK18::Reload() { int iResult; +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_9mm <= 0) return; +#endif if (m_pPlayer->HasShield()) iResult = GLOCK18_SHIELD_RELOAD; diff --git a/regamedll/dlls/wpn_shared/wpn_m249.cpp b/regamedll/dlls/wpn_shared/wpn_m249.cpp index 45d7290be..e08435cdd 100644 --- a/regamedll/dlls/wpn_shared/wpn_m249.cpp +++ b/regamedll/dlls/wpn_shared/wpn_m249.cpp @@ -170,7 +170,7 @@ void CM249::M249Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CM249::Reload() { -#ifdef REGAMEDLL_FIXES +#ifndef REGAMEDLL_FIXES // to prevent reload if not enough ammo if (m_pPlayer->ammo_556natobox <= 0) return; diff --git a/regamedll/dlls/wpn_shared/wpn_m4a1.cpp b/regamedll/dlls/wpn_shared/wpn_m4a1.cpp index 89ea81b5b..e8a686878 100644 --- a/regamedll/dlls/wpn_shared/wpn_m4a1.cpp +++ b/regamedll/dlls/wpn_shared/wpn_m4a1.cpp @@ -229,8 +229,10 @@ void CM4A1::M4A1Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CM4A1::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_556nato <= 0) return; +#endif if (DefaultReload(iMaxClip(), ((m_iWeaponState & WPNSTATE_M4A1_SILENCED) == WPNSTATE_M4A1_SILENCED) ? M4A1_RELOAD : M4A1_UNSIL_RELOAD, M4A1_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_mac10.cpp b/regamedll/dlls/wpn_shared/wpn_mac10.cpp index b05170882..4304931eb 100644 --- a/regamedll/dlls/wpn_shared/wpn_mac10.cpp +++ b/regamedll/dlls/wpn_shared/wpn_mac10.cpp @@ -163,8 +163,10 @@ void CMAC10::MAC10Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CMAC10::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_45acp <= 0) return; +#endif if (DefaultReload(iMaxClip(), MAC10_RELOAD, MAC10_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_mp5navy.cpp b/regamedll/dlls/wpn_shared/wpn_mp5navy.cpp index 3a1b679a6..cefed60bb 100644 --- a/regamedll/dlls/wpn_shared/wpn_mp5navy.cpp +++ b/regamedll/dlls/wpn_shared/wpn_mp5navy.cpp @@ -164,8 +164,10 @@ void CMP5N::MP5NFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CMP5N::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_9mm <= 0) return; +#endif if (DefaultReload(iMaxClip(), MP5N_RELOAD, MP5N_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_p228.cpp b/regamedll/dlls/wpn_shared/wpn_p228.cpp index b64f5fcf3..108d76d72 100644 --- a/regamedll/dlls/wpn_shared/wpn_p228.cpp +++ b/regamedll/dlls/wpn_shared/wpn_p228.cpp @@ -182,8 +182,10 @@ void CP228::P228Fire(float flSpread, float flCycleTime, BOOL fUseSemi) void CP228::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_357sig <= 0) return; +#endif if (DefaultReload(iMaxClip(), m_pPlayer->HasShield() ? P228_SHIELD_RELOAD : P228_RELOAD, P228_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_p90.cpp b/regamedll/dlls/wpn_shared/wpn_p90.cpp index 7f3cc606f..c4c0fa656 100644 --- a/regamedll/dlls/wpn_shared/wpn_p90.cpp +++ b/regamedll/dlls/wpn_shared/wpn_p90.cpp @@ -170,8 +170,10 @@ void CP90::P90Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CP90::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_57mm <= 0) return; +#endif if (DefaultReload(iMaxClip(), P90_RELOAD, P90_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_scout.cpp b/regamedll/dlls/wpn_shared/wpn_scout.cpp index fd9456624..8d07bfcdc 100644 --- a/regamedll/dlls/wpn_shared/wpn_scout.cpp +++ b/regamedll/dlls/wpn_shared/wpn_scout.cpp @@ -186,7 +186,7 @@ void CSCOUT::SCOUTFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CSCOUT::Reload() { -#ifdef REGAMEDLL_FIXES +#ifndef REGAMEDLL_FIXES // to prevent reload if not enough ammo if (m_pPlayer->ammo_762nato <= 0) return; diff --git a/regamedll/dlls/wpn_shared/wpn_sg550.cpp b/regamedll/dlls/wpn_shared/wpn_sg550.cpp index 8263e98a8..0ae73b607 100644 --- a/regamedll/dlls/wpn_shared/wpn_sg550.cpp +++ b/regamedll/dlls/wpn_shared/wpn_sg550.cpp @@ -194,8 +194,10 @@ void CSG550::SG550Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CSG550::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_556nato <= 0) return; +#endif if (DefaultReload(iMaxClip(), SG550_RELOAD, SG550_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_sg552.cpp b/regamedll/dlls/wpn_shared/wpn_sg552.cpp index e86eec412..fe9b31dcc 100644 --- a/regamedll/dlls/wpn_shared/wpn_sg552.cpp +++ b/regamedll/dlls/wpn_shared/wpn_sg552.cpp @@ -180,8 +180,10 @@ void CSG552::SG552Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CSG552::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_556nato <= 0) return; +#endif if (DefaultReload(iMaxClip(), SG552_RELOAD, SG552_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_tmp.cpp b/regamedll/dlls/wpn_shared/wpn_tmp.cpp index 10378abc2..eca575413 100644 --- a/regamedll/dlls/wpn_shared/wpn_tmp.cpp +++ b/regamedll/dlls/wpn_shared/wpn_tmp.cpp @@ -161,7 +161,7 @@ void CTMP::TMPFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CTMP::Reload() { -#ifdef REGAMEDLL_FIXES +#ifndef REGAMEDLL_FIXES // to prevent reload if not enough ammo if (m_pPlayer->ammo_9mm <= 0) return; diff --git a/regamedll/dlls/wpn_shared/wpn_ump45.cpp b/regamedll/dlls/wpn_shared/wpn_ump45.cpp index 73ada761e..5d9deff18 100644 --- a/regamedll/dlls/wpn_shared/wpn_ump45.cpp +++ b/regamedll/dlls/wpn_shared/wpn_ump45.cpp @@ -167,8 +167,10 @@ void CUMP45::UMP45Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) void CUMP45::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_45acp <= 0) return; +#endif if (DefaultReload(iMaxClip(), UMP45_RELOAD, UMP45_RELOAD_TIME)) { diff --git a/regamedll/dlls/wpn_shared/wpn_usp.cpp b/regamedll/dlls/wpn_shared/wpn_usp.cpp index 0d830d690..43ec605dd 100644 --- a/regamedll/dlls/wpn_shared/wpn_usp.cpp +++ b/regamedll/dlls/wpn_shared/wpn_usp.cpp @@ -245,8 +245,10 @@ void CUSP::USPFire(float flSpread, float flCycleTime, BOOL fUseSemi) void CUSP::Reload() { +#ifndef REGAMEDLL_FIXES if (m_pPlayer->ammo_45acp <= 0) return; +#endif int iAnim; if (m_pPlayer->HasShield()) diff --git a/regamedll/public/regamedll/API/CSPlayer.h b/regamedll/public/regamedll/API/CSPlayer.h index 0b8672332..18558a433 100644 --- a/regamedll/public/regamedll/API/CSPlayer.h +++ b/regamedll/public/regamedll/API/CSPlayer.h @@ -51,6 +51,7 @@ class CCSPlayer: public CCSMonster { m_bAutoBunnyHopping(false), m_bMegaBunnyJumping(false), m_bPlantC4Anywhere(false), + m_iAliveNameChanges(0), m_bSpawnProtectionEffects(false), m_flJumpHeight(0), m_flLongJumpHeight(0), @@ -154,6 +155,7 @@ class CCSPlayer: public CCSMonster { bool m_bAutoBunnyHopping; bool m_bMegaBunnyJumping; bool m_bPlantC4Anywhere; + int m_iAliveNameChanges; bool m_bSpawnProtectionEffects; double m_flJumpHeight; double m_flLongJumpHeight; diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 4aeb12545..453f973a7 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -808,6 +808,7 @@ struct ReGameFuncs_t { void (*UTIL_DecalTrace)(TraceResult *pTrace, int decalNumber); void (*UTIL_Remove)(CBaseEntity *pEntity); int (*AddAmmoNameToAmmoRegistry)(const char *szAmmoname); + BOOL(*RemoveAmmoNameFromAmmoRegistry)(const char* szAmmoname); void (*TextureTypePlaySound)(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int iBulletType); class CWeaponBox *(*CreateWeaponBox)(CBasePlayerItem *pItem, CBasePlayer *pPlayerOwner, const char *modelName, Vector &origin, Vector &angles, Vector &velocity, float lifeTime, bool packAmmo); class CGrenade *(*SpawnGrenade)(WeaponIdType weaponId, entvars_t *pevOwner, Vector &vecSrc, Vector &vecThrow, float time, int iTeam, unsigned short usEvent);