[editor] fix

This commit is contained in:
2019-05-14 21:19:20 +03:00
parent 797dfca2be
commit 686c659c84

View File

@@ -36,7 +36,7 @@ class SpawnPointItem extends BitmapItem<SpawnPointEntity> {
public function new(value:SpawnPoint, config:Config) {
src = getSrc(value, config);
super(new SpawnPointEntity(value, new Rectangle(
super(new SpawnPointEntity(0, value, new Rectangle(
value.x * config.map.cellWidth,
value.y * config.map.cellHeight,
config.map.cellWidth * 2,
@@ -196,12 +196,13 @@ class MapEditView extends SpriteView {
private function drawMap() {
for (brick in map.bricks) if (brick.config.index > 0) {
if (!items.exists(brick.key)) {
items[brick.key] = new BrickItem(brick);
var key = Std.string(brick.id);
if (!items.exists(key)) {
items[key] = new BrickItem(brick);
if (brick.config.layer > 2) {
upLayer.addChild(items[brick.key].view);
upLayer.addChild(items[key].view);
} else {
groundLayer.addChild(items[brick.key].view);
groundLayer.addChild(items[key].view);
}
}
}