Fixed issue where preset objects weren't being loaded to correct location

This commit is contained in:
Collin Smith 2019-02-21 16:55:27 -08:00
parent 8cfe8f9090
commit bc4f1f83b8

View File

@ -619,12 +619,14 @@ public class Map implements Disposable {
}
private void loadEntities(DS1 ds1, int gridX, int gridY) {
final int x = this.x + (gridX * DT1.Tile.SUBTILE_SIZE);
final int y = this.y + (gridY * DT1.Tile.SUBTILE_SIZE);
if (entities == EMPTY_ARRAY) entities = new Array<>();
for (int i = 0; i < ds1.numObjects; i++) {
DS1.Object obj = ds1.objects[i];
Entity entity = Entity.create(ds1, obj);
if (entity == null) continue;
entity.position().set(x + gridX + obj.x, y + gridY + obj.y, 0);
entity.position().set(x + obj.x, y + obj.y, 0);
entities.add(entity);
}
}