Skip to content

Commit dedf6af

Browse files
authored
Fix case of self_offset received without a y offset (#864)
caused by typos in #701 it's possible for older clients to send x offsets without a y offset. if you think this case is annoying you can remove it in the next version and handle it server-side instead
1 parent dc58a66 commit dedf6af

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/courtroom.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3977,10 +3977,9 @@ void Courtroom::set_self_offset(const QString& p_list) {
39773977
}
39783978
else {
39793979
self_offset_v = self_offsets[1].toInt();
3980-
ui_vp_player_char->move_and_center(ui_viewport->width() * self_offset / 100, ui_viewport->height() * self_offset_v / 100);
3981-
const int percent = 100;
3982-
ui_vp_player_char->move(ui_viewport->width() * self_offset / percent, ui_viewport->height() * self_offset_v / percent);
39833980
}
3981+
ui_vp_player_char->move_and_center(ui_viewport->width() * self_offset / 100,
3982+
ui_viewport->height() * self_offset_v / 100);
39843983
}
39853984

39863985
void Courtroom::set_ip_list(QString p_list)

0 commit comments

Comments
 (0)