for (y = 0; y < cave->h; y++)
for (x = 0; x < cave->w; x++)
{
- *a += gd_elements[cave->map[y][x]].character;
+ *a += gd_elements[cave->map[y][x] & O_MASK].character;
*b += *a;
*a %= 65521;
}
// add the ckdelay correction value for every element seen.
- cave->ckdelay += gd_elements[get(cave, x, y)].ckdelay;
+ cave->ckdelay += gd_elements[get(cave, x, y) & O_MASK].ckdelay;
switch (get(cave, x, y))
{
for (x = 0; x < cave->w; x++)
{
// add the ckdelay correction value for every element seen.
- cave->ckdelay += gd_elements[get(cave, x, y)].ckdelay;
+ cave->ckdelay += gd_elements[get(cave, x, y) & O_MASK].ckdelay;
}
}
mapping_initialized = TRUE;
}
+ // always map (scanned) run-time elements to normal elements
+ element_bd &= O_MASK;
+
if (element_bd < 0 || element_bd >= O_MAX_ALL)
{
Warn("invalid BD element %d", element_bd);
mapping_initialized = TRUE;
}
+ // always map (scanned) run-time elements to normal elements
+ element_bd &= O_MASK;
+
if (element_bd < 0 || element_bd >= O_MAX_ALL)
{
Warn("invalid BD element %d", element_bd);