Skip to content

Commit

Permalink
fix: Fix prune index not working on id=0
Browse files Browse the repository at this point in the history
object.id should be object.hasOwnProperty("id") to determin it's existence
  • Loading branch information
soimy committed Dec 3, 2019
1 parent c554cdb commit c03204a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/atlasify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,11 @@ export class Atlasify {
private pruneTagIndex (tagCount: { [index: string]: number; }) {
for (let a of this._atlas) {
const tag = a.tag ? a.tag : "_";
if (tagCount[tag] < 1 && a.id) delete a.id;
if (tagCount[tag] < 1 && a.hasOwnProperty("id")) delete a.id;
}
for (let s of this._spritesheets) {
const tag = s.tag ? s.tag : "_";
if (tagCount[tag] < 1 && s.id) delete s.id;
if (tagCount[tag] < 1 && s.hasOwnProperty("id")) delete s.id;
}
}
}
Expand Down

0 comments on commit c03204a

Please sign in to comment.