Skip to content

Commit

Permalink
Update Effects.cpp for consistent behavior when rendering special pat…
Browse files Browse the repository at this point in the history
…terns
  • Loading branch information
LeandroLibanio28H committed Mar 30, 2024
1 parent e6861d7 commit 13fcb09
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/client/effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ void Effect::drawEffect(const Point& dest, float scaleFactor, bool animate, int
}
}

int xPattern = offsetX % getNumPatternX();
if(xPattern < 0)
xPattern += getNumPatternX();
int xPattern = unsigned(offsetX) % getNumPatternX();
xPattern = 1 - xPattern - getNumPatternX();
if (xPattern < 0) xPattern += getNumPatternX();

int yPattern = offsetY % getNumPatternY();
if(yPattern < 0)
yPattern += getNumPatternY();
int yPattern = unsigned(offsetY) % getNumPatternY();

rawGetThingType()->draw(dest, scaleFactor, 0, xPattern, yPattern, 0, animationPhase, lightView);
}
Expand Down

0 comments on commit 13fcb09

Please sign in to comment.