Skip to content

Commit

Permalink
v11 doesn't handle refreshOcclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
Eligarf committed Jun 14, 2024
1 parent 17508f9 commit a5a75fb
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions scripts/stealthy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ export class Stealthy {
this.socket.register('GetPerceptionBanking', this.getPerceptionBanking);
this.socket.register('RefreshPerception', this.refreshPerception);
});
const v11 = Math.floor(game.version) < 12;
if (v11) {
this.refreshOptions = {
refreshLighting: true,
refreshVision: true,
refreshSounds: true
};
} else {
this.refreshOptions = {
refreshLighting: true,
refreshVision: true,
refreshSounds: true,
refreshOcclusion: true
};
}
}

getBankedPerception(token) {
Expand Down Expand Up @@ -62,12 +77,7 @@ export class Stealthy {

refreshPerception() {
Stealthy.log(`RefreshPerception`);
canvas.perception.update({
refreshLighting: true,
refreshVision: true,
refreshSounds: true,
refreshOcclusion: true
});
canvas.perception.update(stealthy.refreshOptions);
}

async getPerceptionBanking() {
Expand Down

0 comments on commit a5a75fb

Please sign in to comment.