Fixed off-by-one team sprite in editor

This commit is contained in:
Anuken 2023-11-02 22:46:15 -04:00
parent e15a4e6bdf
commit 5b5c5d0365

View File

@ -139,12 +139,16 @@ public class MapRenderer implements Disposable{
mesh.draw(idxWall, region, wx * tilesize, wy * tilesize, 8, 8);
}
float offsetX = -(wall.size / 3) * tilesize, offsetY = -(wall.size / 3) * tilesize;
float offsetX = -((wall.size + 1) / 3) * tilesize, offsetY = -((wall.size + 1) / 3) * tilesize;
//draw non-synthetic wall or ore
if((wall.update || wall.destructible) && center){
mesh.setColor(team.color);
region = Core.atlas.find("block-border-editor");
if(wall.size == 2){
offsetX += tilesize;
offsetY += tilesize;
}
}else if(!useSyntheticWall && wall != Blocks.air && center){
region = getIcon(wall, idxWall);