Skip to content

Commit 43c76b7

Browse files
authored
Fix keeping spec from practice (ddnet#11641)
2 parents 0db5366 + 5238ab4 commit 43c76b7

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

src/game/server/teams.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,21 @@ void CGameTeams::OnCharacterDeath(int ClientId, int Weapon)
12351235
ChangeTeamState(Team, ETeamState::OPEN);
12361236

12371237
if(!m_pGameContext->PracticeByDefault())
1238+
{
1239+
if(!g_Config.m_SvPauseable)
1240+
{
1241+
for(int ClientId1 = 0; ClientId1 < MAX_CLIENTS; ClientId1++)
1242+
{
1243+
if(m_Core.Team(ClientId1) == Team)
1244+
{
1245+
CPlayer *pPlayer = GameServer()->m_apPlayers[ClientId1];
1246+
if(pPlayer && pPlayer->IsPaused() == -1 * CPlayer::PAUSE_SPEC)
1247+
pPlayer->Pause(CPlayer::PAUSE_PAUSED, true);
1248+
}
1249+
}
1250+
}
12381251
m_aPractice[Team] = false;
1252+
}
12391253

12401254
if(Count(Team) > 1)
12411255
{

src/game/server/teehistorian.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CTeehistorianPacker : public CAbstractPacker
2424
static const char TEEHISTORIAN_NAME[] = "[email protected]";
2525
static const CUuid TEEHISTORIAN_UUID = CalculateUuid(TEEHISTORIAN_NAME);
2626
static const char TEEHISTORIAN_VERSION[] = "2";
27-
static const char TEEHISTORIAN_VERSION_MINOR[] = "18";
27+
static const char TEEHISTORIAN_VERSION_MINOR[] = "19";
2828

2929
#define UUID(id, name) static const CUuid UUID_##id = CalculateUuid(name);
3030
#include <engine/shared/teehistorian_ex_chunks.h>

src/test/teehistorian_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class TeeHistorian : public ::testing::Test
107107
void Expect(const unsigned char *pOutput, size_t OutputSize)
108108
{
109109
static CUuid TEEHISTORIAN_UUID = CalculateUuid("[email protected]");
110-
static const char PREFIX1[] = "{\"comment\":\"[email protected]\",\"version\":\"2\",\"version_minor\":\"18\",\"game_uuid\":\"a1eb7182-796e-3b3e-941d-38ca71b2a4a8\",\"server_version\":\"DDNet test\",\"start_time\":\"";
110+
static const char PREFIX1[] = "{\"comment\":\"[email protected]\",\"version\":\"2\",\"version_minor\":\"19\",\"game_uuid\":\"a1eb7182-796e-3b3e-941d-38ca71b2a4a8\",\"server_version\":\"DDNet test\",\"start_time\":\"";
111111
static const char PREFIX2[] = "\",\"server_name\":\"server name\",\"server_port\":\"8303\",\"game_type\":\"game type\",\"map_name\":\"Kobra 3 Solo\",\"map_size\":\"903514\",\"map_sha256\":\"0123456789012345678901234567890123456789012345678901234567890123\",\"map_crc\":\"eceaf25c\",\"prng_description\":\"test-prng:02468ace\",\"config\":{},\"tuning\":{},\"uuids\":[";
112112
static const char PREFIX3[] = "]}";
113113

0 commit comments

Comments
 (0)