From: Holger Schemel Date: Wed, 13 Mar 2024 09:08:06 +0000 (+0100) Subject: fixed input of negative numbers to numeric text gadgets X-Git-Tag: 4.4.0.0-test-1~188 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=b1a00c7bf19d3a459d225ee0341fa7b8d4d4cb3b;p=rocksndiamonds.git fixed input of negative numbers to numeric text gadgets --- diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index 64637dc4..844f4f4e 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -2455,8 +2455,7 @@ boolean HandleGadgetsKeyInput(Key key) int cursor_pos = gi->textinput.cursor_position; char letter = getCharFromKey(key); boolean legal_letter = (gi->type == GD_TYPE_TEXT_INPUT_NUMERIC ? - letter >= '0' && letter <= '9' : - letter != 0); + (letter >= '0' && letter <= '9') || letter == '-' : letter != 0); if (legal_letter && text_length < gi->textinput.size) {