Skip to content

Commit b315e9b

Browse files
committed
Fix pairing issues
- Fix an issue where own offset was not sent over - Fix an issue where the pair's emote wasn't read from the JSON - Fix an issue where pair would be displayed no matter if they should be or not
1 parent 9c495ed commit b315e9b

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/courtroom.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2155,6 +2155,7 @@ void Courtroom::on_chat_return_pressed()
21552155
pair_order > 0};
21562156
}
21572157

2158+
packet_contents.m_offset = {char_offset, char_vert_offset};
21582159
packet_contents.m_sfx_looping = !ao_app->get_sfx_looping(current_char, current_emote).compare("0");
21592160
packet_contents.m_screenshake = screenshake_state > 0;
21602161
packet_contents.m_immediate = ui_immediate->isChecked() && ui_pre->isChecked();
@@ -2681,12 +2682,15 @@ void Courtroom::display_character()
26812682

26822683
void Courtroom::display_pair_character(const ms2::OtherData &f_other)
26832684
{
2685+
if (f_other.m_charid == -1)
2686+
return;
2687+
26842688
// Show the pair character
26852689
ui_vp_sideplayer_char->show();
26862690
// Move pair character according to the offsets
26872691
ui_vp_sideplayer_char->move(ui_viewport->width() * f_other.m_offset.x / 100, ui_viewport->height() * f_other.m_offset.y / 100);
26882692

2689-
if (f_other.m_under)
2693+
if (!f_other.m_under)
26902694
ui_vp_sideplayer_char->stackUnder(ui_vp_player_char);
26912695
else
26922696
ui_vp_player_char->stackUnder(ui_vp_sideplayer_char);

src/packets/msdata.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ bool ms2::OtherData::fromJson(const QJsonObject &f_json, OtherData &f_data)
303303
else
304304
return false;
305305

306+
if (const QJsonValue v = f_json["emote"]; v.isString())
307+
f_data.m_emote = v.toString();
308+
else
309+
return false;
310+
306311
if (const QJsonValue v = f_json["offset"]; v.isObject())
307312
{
308313
OffsetData l_offset{0, 0};

0 commit comments

Comments
 (0)