Let any block have variants. (#5372)

This commit is contained in:
MEEP of Faith
2021-06-10 15:42:01 -04:00
committed by GitHub
parent e4bd3fab7c
commit af2830602d
5 changed files with 27 additions and 40 deletions
@@ -907,7 +907,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
}
public void draw(){
Draw.rect(block.region, x, y, block.rotate ? rotdeg() : 0);
if(block.variants == 0){
Draw.rect(block.region, x, y, block.rotate ? rotdeg() : 0);
}else{
Draw.rect(block.variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, block.variantRegions.length - 1))], x, y, block.rotate ? rotdeg() : 0);
}
drawTeamTop();
}