mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #4396
4396: /swap fix: swap started/finished information r=edg-l a=def- Thanks to 冷落 for report <!-- What is the motivation for the changes of this pull request --> ## 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 if it works standalone, system.c especially - [x] Considered possible null pointers and out of bounds array indexing - [x] Changed no physics that affect existing maps - [x] 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: def <dennis@felsin9.de>
This commit is contained in:
commit
d549c2a0f3
|
@ -882,6 +882,9 @@ void CGameTeams::SwapTeamCharacters(CPlayer *pPlayer, CPlayer *pTargetPlayer, in
|
|||
PrimarySavedTee.Load(pTargetPlayer->GetCharacter(), Team, true);
|
||||
SecondarySavedTee.Load(pPlayer->GetCharacter(), Team, true);
|
||||
|
||||
swap(m_TeeStarted[pPlayer->GetCID()], m_TeeStarted[pTargetPlayer->GetCID()]);
|
||||
swap(m_TeeFinished[pPlayer->GetCID()], m_TeeFinished[pTargetPlayer->GetCID()]);
|
||||
|
||||
str_format(aBuf, sizeof(aBuf),
|
||||
"%s has swapped with %s.",
|
||||
Server()->ClientName(pPlayer->GetCID()), Server()->ClientName(pTargetPlayer->GetCID()));
|
||||
|
|
Loading…
Reference in a new issue