Merge pull request #309 from AttorneyOnline/fix-272

When deciding to present evidence, check if we've already done so
This commit is contained in:
oldmud0 2020-10-31 18:26:38 -05:00 committed by GitHub
commit 93f370b062
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

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

View File

@ -1762,6 +1762,7 @@ void Courtroom::reset_ic()
ui_vp_chat_arrow->stop();
text_state = 0;
anim_state = 0;
evidence_presented = false;
ui_vp_objection->stop();
chat_tick_timer->stop();
ui_vp_evidence_display->reset();
@ -2254,7 +2255,8 @@ void Courtroom::handle_chatmessage_3()
.isEmpty()) // Pure whitespace showname, get outta here.
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
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;
@ -2268,6 +2270,8 @@ void Courtroom::handle_chatmessage_3()
tr("has presented evidence"),
m_chatmessage[TEXT_COLOR].toInt());
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();