Fixed rounding error in positioning of overworld weather tile

sprites
This commit is contained in:
Maruno17
2021-05-01 17:22:36 +01:00
parent f29da5fc8f
commit 9007e59668

View File

@@ -326,8 +326,8 @@ module RPG
if @fading && @fade_time >= [FADE_OLD_TONE_END - @time_shift, 0].max
weather_type = @target_type
end
sprite.x = @ox + @tile_x + (index % @tiles_wide) * sprite.bitmap.width
sprite.y = @oy + @tile_y + (index / @tiles_wide) * sprite.bitmap.height
sprite.x = (@ox + @tile_x + (index % @tiles_wide) * sprite.bitmap.width).round
sprite.y = (@oy + @tile_y + (index / @tiles_wide) * sprite.bitmap.height).round
sprite.x += @tiles_wide * sprite.bitmap.width if sprite.x - @ox < -sprite.bitmap.width
sprite.y -= @tiles_tall * sprite.bitmap.height if sprite.y - @oy > Graphics.height
sprite.visible = true