Skip to content

Commit

Permalink
Improve version checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dev7355608 committed Dec 5, 2024
1 parent 4cb8c1c commit 25d8067
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions scripts/_index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Hooks.once("init", () => {
CONFIG.Canvas.darknessSourceClass = PointDarknessSourceMixin(CONFIG.Canvas.darknessSourceClass);
CONFIG.Canvas.soundSourceClass = PointSoundSourceMixin(CONFIG.Canvas.soundSourceClass);

if (game.release.version >= 13) {
if (game.release.generation >= 13) {
if (game.modules.get("lib-wrapper")?.active) {
libWrapper.register(
"limits",
Expand Down Expand Up @@ -83,7 +83,7 @@ Hooks.once("init", () => {
});

Hooks.once("ready", () => {
if (game.release.version < 13) {
if (game.release.generation < 13) {
CONFIG.RegionBehavior.sheetClasses[TYPE]["core.RegionBehaviorConfig"].cls = LimitRangeRegionBehaviorConfig;
}
});
2 changes: 1 addition & 1 deletion scripts/canvas/geometry/constraint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class PointSourcePolygonConstraint extends PIXI.Polygon {

let { x: originX, y: originY, elevation } = this.#origin = polygon.origin;

if (game.release.version < 13) {
if (game.release.generation < 13) {
elevation = polygon.config.source?.elevation ?? 0.0;
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/canvas/sources/darkness.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const PointDarknessSourceMixin = (PointDarknessSource) => class extends P
PointSourcePolygonConstraint.apply(this.shape, Limits.darkness);
}

if (game.release.version >= 13) {
if (game.release.generation >= 13) {
const { x, y, elevation, radius } = this.data;
const z = elevation * canvas.dimensions.distancePixels;
const { left: minX, right: maxX, top: minY, bottom: maxY } = this.shape.bounds;
Expand Down
2 changes: 1 addition & 1 deletion scripts/canvas/sources/light.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const PointLightSourceMixin = (PointLightSource) => class extends PointLi

PointSourcePolygonConstraint.apply(this.shape, Limits.light);

if (game.release.version >= 13) {
if (game.release.generation >= 13) {
const { x, y, elevation, radius } = this.data;
const z = elevation * canvas.dimensions.distancePixels;
const { left: minX, right: maxX, top: minY, bottom: maxY } = this.shape.bounds;
Expand Down
4 changes: 2 additions & 2 deletions scripts/canvas/sources/sound.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const PointSoundSourceMixin = (PointSoundSource) => class extends PointSo
let minZ;
let maxZ;

if (game.release.version >= 13) {
if (game.release.generation >= 13) {
minZ = z - radius;
maxZ = z + radius;
} else {
Expand All @@ -51,7 +51,7 @@ export const PointSoundSourceMixin = (PointSoundSource) => class extends PointSo
if (volume > 0.0) {
let z;

if (game.release.version >= 13) {
if (game.release.generation >= 13) {
z = listener.elevation * canvas.dimensions.distancePixels;
} else {
z = this.#caster.ray.originZ;
Expand Down
2 changes: 1 addition & 1 deletion scripts/canvas/sources/vision.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const PointVisionSourceMixin = (PointVisionSource) => class extends Point
let minZ;
let maxZ;

if (game.release.version >= 13) {
if (game.release.generation >= 13) {
minZ = z - radius;
maxZ = z + radius;
} else {
Expand Down
2 changes: 1 addition & 1 deletion scripts/limits.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default class Limits {
let bottom;
let top;

if (game.release.version >= 13) {
if (game.release.generation >= 13) {
if (!shape) {
polygons = region.polygons;
}
Expand Down

0 comments on commit 25d8067

Please sign in to comment.