Fixed rotated levers not being rendered correctly

This commit is contained in:
tobspr 2020-08-28 22:25:31 +02:00
parent e04fcceecc
commit 5076c03dab
1 changed files with 44 additions and 51 deletions

View File

@ -37,14 +37,7 @@ export class LeverSystem extends GameSystemWithFilter {
const leverComp = entity.components.Lever;
if (leverComp) {
const sprite = leverComp.toggled ? this.spriteOn : this.spriteOff;
const origin = entity.components.StaticMapEntity.origin;
sprite.drawCached(
parameters,
origin.x * globalConfig.tileSize,
origin.y * globalConfig.tileSize,
globalConfig.tileSize,
globalConfig.tileSize
);
entity.components.StaticMapEntity.drawSpriteOnBoundsClipped(parameters, sprite);
}
}
}