Skip to content

Commit

Permalink
feat: getDrawLevel
Browse files Browse the repository at this point in the history
  • Loading branch information
ultraviolet-jordan committed Jan 28, 2024
1 parent b3c3130 commit 530d39a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/js/jagex2/dash3d/World.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,9 @@ export default class World {
return;
}

/*if (this.getDrawLevel(level, x, z) !== levelBuilt) {
if (this.getDrawLevel(level, x, z) !== World.levelBuilt) {
return;
}*/
}
}

const heightSW: number = this.levelHeightmap[level][x][z];
Expand Down Expand Up @@ -763,4 +763,11 @@ export default class World {
}
}
};

private getDrawLevel = (level: number, stx: number, stz: number): number => {
if ((this.levelTileFlags[level][stx][stz] & 0x8) == 0) {
return level <= 0 || (this.levelTileFlags[1][stx][stz] & 0x2) == 0 ? level : level - 1;
}
return 0;
};
}

0 comments on commit 530d39a

Please sign in to comment.