diff --git a/README.md b/README.md index 7222ef2cd..37f44c15f 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure' | :---------------------------------- | :---------------------------------------------- | | game version | Will show GameDLL build version, date & URL. | | endround | Args:
`T` force round end with Terrorists win.
`CT` force round end with Counter-Terrorists win.
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)
diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index d0f43e625..f93345a9e 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -243,7 +243,11 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&autoteambalance); CVAR_REGISTER(&tkpunish); CVAR_REGISTER(&hostagepenalty); + +#ifndef REGAMEDLL_FIXES CVAR_REGISTER(&mirrordamage); +#endif + CVAR_REGISTER(&logmessages); CVAR_REGISTER(&forcecamera); CVAR_REGISTER(&forcechasecam); @@ -320,7 +324,7 @@ void EXT_FUNC GameDLLInit() ADD_SERVER_COMMAND("game", GameDLL_Version_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(&maxmoney); diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index a34fe6d2f..c4a97257e 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -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 CBasePlayer *killer = GetClassPtr((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 pKiller->frags -= IPointsForKill(peKiller, pVictim); diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index c63f81bfa..f15919269 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -835,7 +835,7 @@ BOOL EXT_FUNC CBasePlayer::__API_HOOK(TakeDamage)(entvars_t *pevInflictor, entva CBaseEntity *pAttacker = GET_PRIVATE(ENT(pevAttacker)); // 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; } #endif @@ -1034,7 +1034,7 @@ BOOL EXT_FUNC CBasePlayer::__API_HOOK(TakeDamage)(entvars_t *pevInflictor, entva pAttack = GetClassPtr((CBasePlayer *)pevAttacker); // warn about team attacks - if (!CSGameRules()->IsFreeForAll() && pAttack->m_iTeam == m_iTeam) + if (g_pGameRules->PlayerRelationship(this, pAttack) == GR_TEAMMATE) { if (pAttack != this) { @@ -7748,7 +7748,7 @@ void CBasePlayer::UpdateStatusBar() { 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_TARGETTYPE] = sameTeam ? SBAR_TARGETTYPE_TEAMMATE : SBAR_TARGETTYPE_ENEMY;