Skip to content

Commit

Permalink
chore: fix issue where the last gid for spritesheets wasn't usable
Browse files Browse the repository at this point in the history
 - oops
  • Loading branch information
justindujardin committed Oct 26, 2022
1 parent c83a040 commit e590820
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/app/core/resources/tiled/tiled-tsx.resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,8 @@ export class TiledTSXResource extends XMLResource {
}

hasGid(gid: number): boolean {
return (
this.firstgid !== -1 &&
gid >= this.firstgid &&
gid < this.firstgid + this.maxLocalId
);
const localId = this.firstgid !== -1 ? gid - this.firstgid : gid;
return gid >= this.firstgid && localId <= this.maxLocalId;
}

getTileMeta(gidOrIndex: number): ITileInstanceMeta {
Expand Down

0 comments on commit e590820

Please sign in to comment.