Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update regame #6

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5268e6b
Merge branch 's1lentq:master' into master
aleeperezz16 Jan 2, 2024
e636cbc
PlayerRelationship: GR_TEAMMATE on checking itself
s1lentq Jan 12, 2024
c0f4794
PM_CategorizePosition: Do not stick to the ground of an OBSERVER or N…
s1lentq Jan 12, 2024
02a0516
Reset damage stats on Putin Server
s1lentq Jan 12, 2024
89dda43
fix test demo
s1lentq Jan 12, 2024
051dc07
New ConVar: `mp_defuser_allocation` (#908)
SergeyShorokhov Jan 12, 2024
4b49f63
Fix mismatched damage glock18 in burst mode 18 against 25 (GLOCK18_DA…
s1lentq Jan 19, 2024
2d957a7
utlvector.h fix assert
s1lentq Jan 31, 2024
bde6aa0
Disable door asserts (Resolves #926)
s1lentq Jan 31, 2024
a1af7ca
CBasePlayer::WaterMove: No water sound playback occurs when clients e…
s1lentq Jan 31, 2024
b34d564
PM_CheckWater: Fix for uninitialized waterlevel value for dead player…
s1lentq Jan 31, 2024
aec3ba2
Fixed m_looseBombArea assertion
s1lentq Jan 31, 2024
0bbc4bd
Do not reduce points for suicide due to a fatal fall
s1lentq Jan 31, 2024
5287f2a
Do not reduce points for bot suicide due bot_kill command
s1lentq Jan 31, 2024
0bc4ff1
Support for secondary ammo and extra EF_ flags (#934)
Rafflesian Jan 31, 2024
fb9eb0d
Fix excessive punchangle when getting shield shot (#919)
dystopm Jan 31, 2024
2489213
Resetable g_weaponSlotInfo
s1lentq Feb 1, 2024
f4c4e89
CBasePlayerWeapon::ExtractAmmo: Fixed reverse-engineering mistake
s1lentq Feb 1, 2024
4d90a5f
CWeaponBox::Touch: Fix grenade pickup (Resolves #923, Closes #931)
s1lentq Feb 1, 2024
5d2174f
CWeaponBox::Touch: Reworked dropped grenade pickup
s1lentq Feb 4, 2024
d48fd3e
Merge remote-tracking branch 'upstream/master'
aleeperezz16 Feb 14, 2024
9277582
IsWalkableTraceLineClear: Fixed deadlock (mutual collisions in traces…
s1lentq Feb 28, 2024
a4cd9a5
Merge branch 's1lentq:master' into master
aleeperezz16 Mar 13, 2024
af9a707
Merge branch 'nostalgia' into master
aleeperezz16 Mar 16, 2024
c99de03
Revert "Merge branch 'nostalgia' into master"
aleeperezz16 Mar 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: C/C++ CI

on:
push:
branches: [master, nostalgia]
branches: [master]
paths-ignore:
- '**.md'

Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ 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.<br/>`0` New behavior <br/>`1` Legacy behavior |
| mp_max_alive_name_changes | -1 | -1 | - | Maximum amount of nickname changes when alive<br/>`-1` unlimited<br/>`0` Blocks name changes </br>`>0` Allow to change arbitrary amount of nicks |
| sv_legacy_restart_entities | 0 | 0 | 1 | Legacy restart of entities on new round<br/>`0` disabled<br/>`1` enabled |
| sv_block_vote_commands | 0 | 0 | 1 | When set, blocks `vote` and `votemap` commands.<br/>`0` disabled <br/>`1` enabled |
| mp_dying_time | 3.0 | 0.0 | - | Time for switch to free observing after death.<br/>`0` - disable spectating around death.<br/>`>0.00001` - time delay to start spectate.<br/>`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.<br/>`0` disabled<br/>`a` position where the victim died<br/>`b` index of the assistant who helped the attacker kill the victim<br/>`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. |
Expand Down
21 changes: 0 additions & 21 deletions dist/game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -529,27 +529,6 @@ 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.
Expand Down
1 change: 0 additions & 1 deletion regamedll/dlls/API/CAPI_Impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ ReGameFuncs_t g_ReGameApiFuncs = {
UTIL_Remove_api,

AddAmmoNameToAmmoRegistry_api,
RemoveAmmoNameFromAmmoRegistry,
TextureTypePlaySound_api,
CreateWeaponBox_api,
SpawnGrenade_api,
Expand Down
2 changes: 0 additions & 2 deletions regamedll/dlls/API/CSPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ void CCSPlayer::ResetVars()
m_bGameForcingRespawn = false;
m_bAutoBunnyHopping = false;
m_bMegaBunnyJumping = false;
m_iAliveNameChanges = 0;
m_bSpawnProtectionEffects = false;
}

Expand All @@ -565,7 +564,6 @@ void CCSPlayer::OnSpawn()
{
m_bGameForcingRespawn = false;
m_flRespawnPending = 0.0f;
m_iAliveNameChanges = 0;
m_DamageList.Clear();
}

Expand Down
12 changes: 2 additions & 10 deletions regamedll/dlls/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2590,11 +2590,7 @@ void EXT_FUNC InternalCommand(edict_t *pEntity, const char *pcmd, const char *pa
pPlayer->ForceClientDllUpdate();
}
}
else if (FStrEq(pcmd, "vote")
#ifdef REGAMEDLL_ADD
&& sv_block_vote_commands.value <= 0
#endif
)
else if (FStrEq(pcmd, "vote"))
{
if (gpGlobals->time >= pPlayer->m_flLastCommandTime[CMD_VOTE])
{
Expand Down Expand Up @@ -2675,11 +2671,7 @@ void EXT_FUNC InternalCommand(edict_t *pEntity, const char *pcmd, const char *pa
CSGameRules()->DisplayMaps(pPlayer, 0);
}
}
else if (FStrEq(pcmd, "votemap")
#ifdef REGAMEDLL_ADD
&& sv_block_vote_commands.value <= 0
#endif
)
else if (FStrEq(pcmd, "votemap"))
{
if (gpGlobals->time >= pPlayer->m_flLastCommandTime[CMD_VOTEMAP])
{
Expand Down
7 changes: 0 additions & 7 deletions regamedll/dlls/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ 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

Expand Down
11 changes: 3 additions & 8 deletions regamedll/dlls/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,8 @@ 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 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 hostages_rescued_ratio = { "mp_hostages_rescued_ratio", "1.0", 0, 1.0f, nullptr };

cvar_t legacy_vehicle_block = { "mp_legacy_vehicle_block", "1", 0, 0.0f, nullptr };

Expand Down Expand Up @@ -432,7 +429,9 @@ 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);
Expand All @@ -443,10 +442,6 @@ 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");

Expand Down
4 changes: 0 additions & 4 deletions regamedll/dlls/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ 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;
Expand Down
51 changes: 18 additions & 33 deletions regamedll/dlls/multiplay_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,16 +607,11 @@ LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, CleanUpMap)
void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CleanUpMap)()
{
#ifdef REGAMEDLL_FIXES
#ifdef REGAMEDLL_ADD
if (!(bool)legacy_restart_entities.value)
#endif
{
UTIL_RestartOther("multi_manager");
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),
Expand All @@ -627,16 +622,11 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CleanUpMap)()
UTIL_RestartOther("func_door");

#ifdef REGAMEDLL_FIXES
#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");
}
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");
Expand All @@ -649,20 +639,15 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CleanUpMap)()
UTIL_RestartOther("env_sprite");

#ifdef REGAMEDLL_FIXES
#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");
}
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
Expand Down
18 changes: 1 addition & 17 deletions regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,7 @@ bool EXT_FUNC CBasePlayer::__API_HOOK(SetClientUserInfoName)(char *infobuffer, c
}
#endif

#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
)
if (pev->deadflag != DEAD_NO)
{
m_bHasChangedName = true;
Q_snprintf(m_szNewName, sizeof(m_szNewName), "%s", szNewName);
Expand All @@ -201,10 +189,6 @@ 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;
}
Expand Down
54 changes: 3 additions & 51 deletions regamedll/dlls/weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,28 +212,6 @@ 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)
Expand All @@ -244,32 +222,6 @@ 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++)
{
Expand Down Expand Up @@ -308,7 +260,6 @@ 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
Expand Down Expand Up @@ -1277,9 +1228,10 @@ void CBasePlayerItem::AttachToPlayer(CBasePlayer *pPlayer)
void CBasePlayerWeapon::Spawn()
{
#ifdef REGAMEDLL_API
ItemInfo &info = m_ItemInfoArray[m_iId];
ItemInfo info;
Q_memset(&info, 0, sizeof(info));

if (info.iId) {
if (GetItemInfo(&info)) {
CSPlayerItem()->SetItemInfo(&info);
}
#endif
Expand Down
1 change: 0 additions & 1 deletion regamedll/dlls/weapons.h
Original file line number Diff line number Diff line change
Expand Up @@ -2181,5 +2181,4 @@ 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
2 changes: 1 addition & 1 deletion regamedll/dlls/wpn_shared/wpn_ak47.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void CAK47::AK47Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim)

void CAK47::Reload()
{
#ifndef REGAMEDLL_FIXES
#ifdef REGAMEDLL_FIXES
// to prevent reload if not enough ammo
if (m_pPlayer->ammo_762nato <= 0)
return;
Expand Down
2 changes: 0 additions & 2 deletions regamedll/dlls/wpn_shared/wpn_aug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,8 @@ 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))
{
Expand Down
2 changes: 0 additions & 2 deletions regamedll/dlls/wpn_shared/wpn_awp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,8 @@ 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))
{
Expand Down
2 changes: 0 additions & 2 deletions regamedll/dlls/wpn_shared/wpn_deagle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,8 @@ 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))
{
Expand Down
Loading
Loading