mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-06-13 22:32:07 +03:00
Refactoring (#540)
* Rename CMD mp_swapteams * Remove unused CVar mp_mirrordamage * Refactoring checks
This commit is contained in:
parent
913bfc6609
commit
fc52871739
@ -27,7 +27,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
|
|||||||
| :---------------------------------- | :---------------------------------------------- |
|
| :---------------------------------- | :---------------------------------------------- |
|
||||||
| game version | Will show GameDLL build version, date & URL. |
|
| game version | Will show GameDLL build version, date & URL. |
|
||||||
| endround | Args:<br/>`T` force round end with Terrorists win. <br/>`CT` force round end with Counter-Terrorists win. <br/> or terminate round draw when called without arguments. |
|
| endround | Args:<br/>`T` force round end with Terrorists win. <br/>`CT` force round end with Counter-Terrorists win. <br/> or terminate round draw when called without arguments. |
|
||||||
| mp_swapteams | Swap the teams and restart the game. |
|
| swapteams | Swap the teams and restart the game. |
|
||||||
|
|
||||||
## Configuration (cvars)
|
## Configuration (cvars)
|
||||||
<details>
|
<details>
|
||||||
|
@ -243,7 +243,11 @@ void EXT_FUNC GameDLLInit()
|
|||||||
CVAR_REGISTER(&autoteambalance);
|
CVAR_REGISTER(&autoteambalance);
|
||||||
CVAR_REGISTER(&tkpunish);
|
CVAR_REGISTER(&tkpunish);
|
||||||
CVAR_REGISTER(&hostagepenalty);
|
CVAR_REGISTER(&hostagepenalty);
|
||||||
|
|
||||||
|
#ifndef REGAMEDLL_FIXES
|
||||||
CVAR_REGISTER(&mirrordamage);
|
CVAR_REGISTER(&mirrordamage);
|
||||||
|
#endif
|
||||||
|
|
||||||
CVAR_REGISTER(&logmessages);
|
CVAR_REGISTER(&logmessages);
|
||||||
CVAR_REGISTER(&forcecamera);
|
CVAR_REGISTER(&forcecamera);
|
||||||
CVAR_REGISTER(&forcechasecam);
|
CVAR_REGISTER(&forcechasecam);
|
||||||
@ -320,7 +324,7 @@ void EXT_FUNC GameDLLInit()
|
|||||||
|
|
||||||
ADD_SERVER_COMMAND("game", GameDLL_Version_f);
|
ADD_SERVER_COMMAND("game", GameDLL_Version_f);
|
||||||
ADD_SERVER_COMMAND("endround", GameDLL_EndRound_f);
|
ADD_SERVER_COMMAND("endround", GameDLL_EndRound_f);
|
||||||
ADD_SERVER_COMMAND("mp_swapteams", GameDLL_SwapTeams_f);
|
ADD_SERVER_COMMAND("swapteams", GameDLL_SwapTeams_f);
|
||||||
|
|
||||||
CVAR_REGISTER(&game_version);
|
CVAR_REGISTER(&game_version);
|
||||||
CVAR_REGISTER(&maxmoney);
|
CVAR_REGISTER(&maxmoney);
|
||||||
|
@ -3910,9 +3910,8 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(PlayerKilled)(CBasePlayer *pVictim,
|
|||||||
{
|
{
|
||||||
// if a player dies in a deathmatch game and the killer is a client, award the killer some points
|
// if a player dies in a deathmatch game and the killer is a client, award the killer some points
|
||||||
CBasePlayer *killer = GetClassPtr<CCSPlayer>((CBasePlayer *)pKiller);
|
CBasePlayer *killer = GetClassPtr<CCSPlayer>((CBasePlayer *)pKiller);
|
||||||
bool killedByFFA = IsFreeForAll();
|
|
||||||
|
|
||||||
if (killer->m_iTeam == pVictim->m_iTeam && !killedByFFA)
|
if (g_pGameRules->PlayerRelationship(pVictim, killer) == GR_TEAMMATE)
|
||||||
{
|
{
|
||||||
// if a player dies by from teammate
|
// if a player dies by from teammate
|
||||||
pKiller->frags -= IPointsForKill(peKiller, pVictim);
|
pKiller->frags -= IPointsForKill(peKiller, pVictim);
|
||||||
|
@ -835,7 +835,7 @@ BOOL EXT_FUNC CBasePlayer::__API_HOOK(TakeDamage)(entvars_t *pevInflictor, entva
|
|||||||
CBaseEntity *pAttacker = GET_PRIVATE<CBaseEntity>(ENT(pevAttacker));
|
CBaseEntity *pAttacker = GET_PRIVATE<CBaseEntity>(ENT(pevAttacker));
|
||||||
|
|
||||||
// don't take damage if victim has protection
|
// don't take damage if victim has protection
|
||||||
if (((pAttacker && pAttacker->IsPlayer()) || (bitsDamageType & DMG_FALL)) && CSPlayer()->GetProtectionState() == CCSPlayer::ProtectionSt_Active)
|
if (((pAttacker && pAttacker->IsPlayer()) || (bitsDamageType & DMG_FALL)) && CSPlayer()->GetProtectionState() == CCSPlayer::ProtectionSt_Active)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1034,7 +1034,7 @@ BOOL EXT_FUNC CBasePlayer::__API_HOOK(TakeDamage)(entvars_t *pevInflictor, entva
|
|||||||
pAttack = GetClassPtr<CCSPlayer>((CBasePlayer *)pevAttacker);
|
pAttack = GetClassPtr<CCSPlayer>((CBasePlayer *)pevAttacker);
|
||||||
|
|
||||||
// warn about team attacks
|
// warn about team attacks
|
||||||
if (!CSGameRules()->IsFreeForAll() && pAttack->m_iTeam == m_iTeam)
|
if (g_pGameRules->PlayerRelationship(this, pAttack) == GR_TEAMMATE)
|
||||||
{
|
{
|
||||||
if (pAttack != this)
|
if (pAttack != this)
|
||||||
{
|
{
|
||||||
@ -7748,7 +7748,7 @@ void CBasePlayer::UpdateStatusBar()
|
|||||||
{
|
{
|
||||||
CBasePlayer *pTarget = (CBasePlayer *)pEntity;
|
CBasePlayer *pTarget = (CBasePlayer *)pEntity;
|
||||||
|
|
||||||
bool sameTeam = !CSGameRules()->IsFreeForAll() && pTarget->m_iTeam == m_iTeam;
|
bool sameTeam = g_pGameRules->PlayerRelationship(this, pTarget) == GR_TEAMMATE;
|
||||||
|
|
||||||
newSBarState[SBAR_ID_TARGETNAME] = ENTINDEX(pTarget->edict());
|
newSBarState[SBAR_ID_TARGETNAME] = ENTINDEX(pTarget->edict());
|
||||||
newSBarState[SBAR_ID_TARGETTYPE] = sameTeam ? SBAR_TARGETTYPE_TEAMMATE : SBAR_TARGETTYPE_ENEMY;
|
newSBarState[SBAR_ID_TARGETTYPE] = sameTeam ? SBAR_TARGETTYPE_TEAMMATE : SBAR_TARGETTYPE_ENEMY;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user