home · contact · privacy
Add safeguards against illegal rows/cols values.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 31 Oct 2020 10:26:48 +0000 (11:26 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 31 Oct 2020 10:26:48 +0000 (11:26 +0100)
new2/rogue_chat_nocanvas_monochrome.html

index 754021f6ead49f6f6f4d5ad3aa010c26ab35a701..96ad0545ed55988a633f4e2f0b37a0f7804a53f0 100644 (file)
@@ -593,10 +593,16 @@ wasd_selector.addEventListener('input', function() {
     tui.init_wasd();
 }, false);
 rows_selector.addEventListener('input', function() {
+    if (rows_selector.value % 2 != 0) {
+        return;
+    }
     terminal.initialize();
     tui.full_refresh();
 }, false);
 cols_selector.addEventListener('input', function() {
+    if (cols_selector.value % 4 != 0) {
+        return;
+    }
     terminal.initialize();
     tui.window_width = terminal.cols / 2,
     tui.full_refresh();