if (c->position == POS_CE)
{
// calculate playfield position (with scrolling) for related CE tile
+ // (do not use FX/FY, which are incorrect during envelope requests)
+ int FX0 = 2 * TILEX_VAR; // same as FX during DRAW_TO_FIELDBUFFER
+ int FY0 = 2 * TILEY_VAR; // same as FY during DRAW_TO_FIELDBUFFER
int fx = getFieldbufferOffsetX_RND(ScreenMovDir, ScreenGfxPos);
int fy = getFieldbufferOffsetY_RND(ScreenMovDir, ScreenGfxPos);
- int sx = FX + SCREENX(part->tile_x) * TILEX_VAR;
- int sy = FY + SCREENY(part->tile_y) * TILEY_VAR;
+ int sx = FX0 + SCREENX(part->tile_x) * TILEX_VAR;
+ int sy = FY0 + SCREENY(part->tile_y) * TILEY_VAR;
int cx = SX - REAL_SX;
int cy = SY - REAL_SY;
int x = sx - fx + cx;