From 73b6e72ab90934eea7118793a1b71b9b53d508c8 Mon Sep 17 00:00:00 2001 From: Cerapter Date: Mon, 17 Dec 2018 11:08:20 +0100 Subject: Fix judge buttons not appearing & crash if MS goes down during play. The former was caused by the position dropdown simply not having code to make the judge buttons appear. Alongside that, the issue(?) where `/pos judddd` (or variations) would not put the user in the judge position, but gave them the buttons anyway. The latter was caused by a simple mistake. We deleted the Lobby (and the Courtroom) frequently, however, we never did set its (their) pointer(s) back to null -- so they pointer to trash data, and the `if (w_lobby != nullptr)` part never failed. This is also now fixed, and deletion of the Lobby or the Courtroom also brings about the nulling of their pointers. --- courtroom.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'courtroom.h') diff --git a/courtroom.h b/courtroom.h index 874b682..ec9f9ef 100644 --- a/courtroom.h +++ b/courtroom.h @@ -204,6 +204,9 @@ public: //state is an number between 0 and 10 inclusive void set_hp_bar(int p_bar, int p_state); + //Toggles the judge buttons, whether they should appear or not. + void toggle_judge_buttons(bool is_on); + void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno); void check_connection_received(); -- cgit