From 562dee6e38f57d904a081dca623988c3aa27a084 Mon Sep 17 00:00:00 2001 From: def Date: Sun, 21 May 2017 01:20:04 +0200 Subject: [PATCH] Clean up server messages a bit --- src/game/server/ddracechat.cpp | 5 ++++- src/game/server/teams.cpp | 13 +++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/game/server/ddracechat.cpp b/src/game/server/ddracechat.cpp index 6fc3112dc..1fccda6bd 100644 --- a/src/game/server/ddracechat.cpp +++ b/src/game/server/ddracechat.cpp @@ -819,7 +819,10 @@ void CGameContext::ConInviteTeam(IConsole::IResult *pResult, void *pUserData) str_format(aBuf, sizeof aBuf, "'%s' invited you to team %d.", pSelf->Server()->ClientName(pResult->m_ClientID), Team); pSelf->SendChatTarget(Target, aBuf); - pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "invite", "Player has been notified"); + str_format(aBuf, sizeof aBuf, "'%s' invited '%s' to your team.", pSelf->Server()->ClientName(pResult->m_ClientID), pSelf->Server()->ClientName(Target));; + for (int i = 0; i < MAX_CLIENTS; i++) + if (((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.m_Core.Team(i) == Team) + pSelf->SendChatTarget(i, aBuf); } else pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "invite", "Can't invite players to this team"); diff --git a/src/game/server/teams.cpp b/src/game/server/teams.cpp index 895a529ee..b2815c6c5 100644 --- a/src/game/server/teams.cpp +++ b/src/game/server/teams.cpp @@ -629,16 +629,17 @@ void CGameTeams::OnCharacterDeath(int ClientID, int Weapon) ChangeTeamState(Team, CGameTeams::TEAMSTATE_OPEN); char aBuf[512]; - str_format(aBuf, sizeof(aBuf), "Everyone in your locked team was killed because you %s.", Weapon == WEAPON_SELF ? "killed" : "died"); - GameServer()->SendChatTarget(ClientID, aBuf); str_format(aBuf, sizeof(aBuf), "Everyone in your locked team was killed because '%s' %s.", Server()->ClientName(ClientID), Weapon == WEAPON_SELF ? "killed" : "died"); for (int i = 0; i < MAX_CLIENTS; i++) - if(m_Core.Team(i) == Team && i != ClientID && GameServer()->m_apPlayers[i]) + if(m_Core.Team(i) == Team && GameServer()->m_apPlayers[i]) { - GameServer()->m_apPlayers[i]->KillCharacter(WEAPON_SELF); - if (Weapon == WEAPON_SELF) - GameServer()->m_apPlayers[i]->Respawn(true); // spawn the rest of team with weak hook on the killer + if(i != ClientID) + { + GameServer()->m_apPlayers[i]->KillCharacter(WEAPON_SELF); + if (Weapon == WEAPON_SELF) + GameServer()->m_apPlayers[i]->Respawn(true); // spawn the rest of team with weak hook on the killer + } GameServer()->SendChatTarget(i, aBuf); } }