fix REPL crash (ignoring BOUNDS_CHECK for now)

This commit is contained in:
jacob1 2014-08-11 01:11:58 -04:00
parent 7740980fcc
commit 774fb88002

View File

@ -54,7 +54,7 @@ int Element_REPL::update(UPDATE_FUNC_ARGS)
{
rx = (rand()%21)-10;
ry = (rand()%21)-10;
if (BOUNDS_CHECK && (rx || ry))
if (x+rx >= 0 && x+rx < XRES && y+ry >= 0 && y+ry < YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)