From d2324a2fcb0d4562ff2da13bb7f92f291589d6b4 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 31 Oct 2020 11:26:48 +0100 Subject: [PATCH] Add safeguards against illegal rows/cols values. --- new2/rogue_chat_nocanvas_monochrome.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/new2/rogue_chat_nocanvas_monochrome.html b/new2/rogue_chat_nocanvas_monochrome.html index 754021f..96ad054 100644 --- a/new2/rogue_chat_nocanvas_monochrome.html +++ b/new2/rogue_chat_nocanvas_monochrome.html @@ -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(); -- 2.30.2