mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #6606
6606: Only run `KillTeam()` when team has more than 1 tee r=def- a=VoxelDoesCode I also put the `aBuf` segment in there, because why should it even write if it's not going to be sent? ## Checklist - [x] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [x] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [ ] Considered possible null pointers and out of bounds array indexing - [x] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: VoxelDoesCode <dante_n_cedroni@hotmail.com>
This commit is contained in:
commit
4091d394df
|
@ -1061,14 +1061,15 @@ 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 '%s' %s.", Server()->ClientName(ClientID), Weapon == WEAPON_SELF ? "killed" : "died");
|
||||
|
||||
m_aPractice[Team] = false;
|
||||
|
||||
KillTeam(Team, Weapon == WEAPON_SELF ? ClientID : -1, ClientID);
|
||||
if(Count(Team) > 1)
|
||||
{
|
||||
KillTeam(Team, Weapon == WEAPON_SELF ? ClientID : -1, ClientID);
|
||||
|
||||
char aBuf[512];
|
||||
str_format(aBuf, sizeof(aBuf), "Everyone in your locked team was killed because '%s' %s.", Server()->ClientName(ClientID), Weapon == WEAPON_SELF ? "killed" : "died");
|
||||
|
||||
GameServer()->SendChatTeam(Team, aBuf);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue