fixed accessing array out of bounds
[rocksndiamonds.git] / src / anim.c
index aa005263a2f03c0feb619382b0ebdd60398fb5ad..c4952d700167e4516274d694648cf70c51262ecc 100644 (file)
@@ -411,7 +411,8 @@ static void InitToonControls(void)
     int sound = SND_UNDEFINED;
     int music = MUS_UNDEFINED;
     int graphic = IMG_TOON_1 + i;
-    int control = graphic;
+
+    control = graphic;
 
     part->nr = part_nr;
     part->anim_nr = anim_nr;
@@ -1176,12 +1177,12 @@ static boolean isClickedPart(struct GlobalAnimPartControlInfo *part,
 
 static boolean clickBlocked(struct GlobalAnimPartControlInfo *part)
 {
-  return (part->control_info.style & STYLE_BLOCK ? TRUE : FALSE);
+  return ((part->control_info.style & STYLE_BLOCK) ? TRUE : FALSE);
 }
 
 static boolean clickConsumed(struct GlobalAnimPartControlInfo *part)
 {
-  return (part->control_info.style & STYLE_PASSTHROUGH ? FALSE : TRUE);
+  return ((part->control_info.style & STYLE_PASSTHROUGH) ? FALSE : TRUE);
 }
 
 static void InitGlobalAnim_Triggered(struct GlobalAnimPartControlInfo *part,