From: Holger Schemel Date: Sun, 17 Feb 2019 23:12:14 +0000 (+0100) Subject: fixed bug causing access to negative array index X-Git-Tag: 4.1.2.0~2 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1fc11ecd0789cf873639c9bbbff6f72656abac08;p=rocksndiamonds.git fixed bug causing access to negative array index --- diff --git a/src/editor.c b/src/editor.c index 3fa42f10..093b2290 100644 --- a/src/editor.c +++ b/src/editor.c @@ -10876,7 +10876,6 @@ static void SetElementIntelliDraw(int x, int y, int new_element, }; static int last_x = -1; static int last_y = -1; - int old_element = IntelliDrawBuffer[x][y]; if (new_element == EL_UNDEFINED) { @@ -10886,6 +10885,8 @@ static void SetElementIntelliDraw(int x, int y, int new_element, return; } + int old_element = IntelliDrawBuffer[x][y]; + if (IS_TUBE(new_element)) { int last_element_new = EL_UNDEFINED;