projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed crash bug caused by accessing invalid (off-playfield) array positions
[rocksndiamonds.git]
/
src
/
tools.c
diff --git
a/src/tools.c
b/src/tools.c
index 0872e24bc1fde98a5459eff7dda8fff43ae68293..6a998afb360639bb7611ac472c06ff6b0c7bf497 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-1996,11
+1996,11
@@
void DrawScreenElementExt(int x, int y, int dx, int dy, int element,
int graphic;
int frame;
int graphic;
int frame;
- if (element == EL_EMPTY)
- element = GfxElementEmpty[lx][ly];
-
if (IN_LEV_FIELD(lx, ly))
{
if (IN_LEV_FIELD(lx, ly))
{
+ if (element == EL_EMPTY)
+ element = GfxElementEmpty[lx][ly];
+
SetRandomAnimationValue(lx, ly);
graphic = el_act_dir2img(element, GfxAction[lx][ly], GfxDir[lx][ly]);
SetRandomAnimationValue(lx, ly);
graphic = el_act_dir2img(element, GfxAction[lx][ly], GfxDir[lx][ly]);