Remove left over check

This commit is contained in:
Bigjango13 2024-03-18 19:58:38 -04:00
parent 8de638eb1a
commit a6ad1994de

View File

@ -100,23 +100,17 @@ CUSTOM_VTABLE(chat_screen, Screen) {
// Up // Up
local_history.at(self->history_pos) = self->chat->getText(); local_history.at(self->history_pos) = self->chat->getText();
// Change // Change
int old_pos = self->history_pos;
self->history_pos -= 1; self->history_pos -= 1;
if (self->history_pos < 0) self->history_pos = local_history.size() - 1; if (self->history_pos < 0) self->history_pos = local_history.size() - 1;
if (old_pos != self->history_pos) {
self->chat->setText(local_history.at(self->history_pos)); self->chat->setText(local_history.at(self->history_pos));
}
return; return;
} else if (key == 0x28) { } else if (key == 0x28) {
// Down // Down
local_history.at(self->history_pos) = self->chat->getText(); local_history.at(self->history_pos) = self->chat->getText();
// Change // Change
int old_pos = self->history_pos;
self->history_pos += 1; self->history_pos += 1;
if (self->history_pos > int(local_history.size()) - 1) self->history_pos = 0; if (self->history_pos > int(local_history.size()) - 1) self->history_pos = 0;
if (old_pos != self->history_pos) {
self->chat->setText(local_history.at(self->history_pos)); self->chat->setText(local_history.at(self->history_pos));
}
return; return;
} }
} }