add variable check for evidence presenting

This commit is contained in:
in1tiate 2020-09-19 04:12:40 -05:00
parent aa6f073ea8
commit 48f8d8aa27
2 changed files with 9 additions and 1 deletions

View File

@ -424,8 +424,12 @@ private:
// List of all currently available pos // List of all currently available pos
QStringList pos_dropdown_list; QStringList pos_dropdown_list;
// is the message we're about to send supposed to present evidence?
bool is_presenting_evidence = false; bool is_presenting_evidence = false;
// have we already presented evidence for this message?
bool evidence_presented = false;
QString effect = ""; QString effect = "";
// Music effect flags we want to send to server when we play music // Music effect flags we want to send to server when we play music

View File

@ -1763,6 +1763,7 @@ void Courtroom::reset_ic()
ui_vp_chat_arrow->stop(); ui_vp_chat_arrow->stop();
text_state = 0; text_state = 0;
anim_state = 0; anim_state = 0;
evidence_presented = false;
ui_vp_objection->stop(); ui_vp_objection->stop();
chat_tick_timer->stop(); chat_tick_timer->stop();
ui_vp_evidence_display->reset(); ui_vp_evidence_display->reset();
@ -2255,7 +2256,8 @@ void Courtroom::handle_chatmessage_3()
.isEmpty()) // Pure whitespace showname, get outta here. .isEmpty()) // Pure whitespace showname, get outta here.
f_showname = m_chatmessage[CHAR_NAME]; f_showname = m_chatmessage[CHAR_NAME];
if (f_evi_id > 0 && f_evi_id <= local_evidence_list.size()) { if (f_evi_id > 0 && f_evi_id <= local_evidence_list.size() &&
!evidence_presented) {
// shifted by 1 because 0 is no evidence per legacy standards // shifted by 1 because 0 is no evidence per legacy standards
QString f_image = local_evidence_list.at(f_evi_id - 1).image; QString f_image = local_evidence_list.at(f_evi_id - 1).image;
QString f_evi_name = local_evidence_list.at(f_evi_id - 1).name; QString f_evi_name = local_evidence_list.at(f_evi_id - 1).name;
@ -2269,6 +2271,8 @@ void Courtroom::handle_chatmessage_3()
tr("has presented evidence"), tr("has presented evidence"),
m_chatmessage[TEXT_COLOR].toInt()); m_chatmessage[TEXT_COLOR].toInt());
append_ic_text(f_evi_name, f_showname, tr("has presented evidence")); append_ic_text(f_evi_name, f_showname, tr("has presented evidence"));
evidence_presented = true; // we're done presenting evidence, and we
// don't want to do it twice
} }
int emote_mod = m_chatmessage[EMOTE_MOD].toInt(); int emote_mod = m_chatmessage[EMOTE_MOD].toInt();