Fix current_display_speed overflow (#232)

This commit is contained in:
windrammer 2020-08-04 09:03:40 -06:00 committed by GitHub
parent ec1c95bdb3
commit 07e1127096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2914,6 +2914,12 @@ void Courtroom::chat_tick()
next_character_is_not_special = false;
}
// Keep the speed at bay.
if (current_display_speed < 0)
current_display_speed = 0;
else if (current_display_speed > 6)
current_display_speed = 6;
if ((message_display_speed[current_display_speed] <= 0 &&
tick_pos < f_message.size() - 1) ||
formatting_char) {
@ -2942,12 +2948,6 @@ void Courtroom::chat_tick()
ui_vp_message->ensureCursorVisible();
// Keep the speed at bay.
if (current_display_speed < 0)
current_display_speed = 0;
else if (current_display_speed > 6)
current_display_speed = 6;
// Blip player and real tick pos ticker
if (!formatting_char && (f_character != ' ' || blank_blip)) {
if (blip_ticker % blip_rate == 0) {