From 72155939d554617aaf2e9f3b57064350a62f18a0 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sun, 17 Sep 2023 12:49:18 -0700 Subject: [PATCH] don't send spectator join commands if battle is already finished --- TODO.md | 2 +- src/ReceiveCommands.cc | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index 5661e205..f2303d8c 100644 --- a/TODO.md +++ b/TODO.md @@ -19,7 +19,7 @@ - Make disconnecting during a tournament match cause you to forfeit the match - Enforce tournament deck restrictions (e.g. rarity checks, No Assist option) when populating COMs at tournament start time - Spectator teams - - Fix behavior when joining a spectator team after the beginning of a battle + - Send 6xB4x4C, etc. commands when joining a spectator team - maybe this makes it load faster? - Figure out why spectators crash during replays sometimes - Spectator teams sometimes stop receiving commands during live battles? diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 50fc8001..f222d117 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -3505,8 +3505,10 @@ static void on_6F(shared_ptr s, shared_ptr c, l->battle_player->start(); } else if (watched_lobby && watched_lobby->ep3_server) { send_ep3_update_spectator_count(watched_lobby); - watched_lobby->ep3_server->send_commands_for_joining_spectator( - c->channel, c->flags & Client::Flag::IS_EP3_TRIAL_EDITION); + if (!watched_lobby->ep3_server->battle_finished) { + watched_lobby->ep3_server->send_commands_for_joining_spectator( + c->channel, c->flags & Client::Flag::IS_EP3_TRIAL_EDITION); + } } // If there are more players to bring in, try to do so