Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Sep 3, 2024
1 parent 332046c commit 2b9aed1
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 36 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion packs/levels-samples/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-003108
MANIFEST-003124
11 changes: 3 additions & 8 deletions packs/levels-samples/LOG
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
2024/09/01-17:59:16.832 7afc Recovering log #3107
2024/09/01-17:59:16.834 7afc Delete type=0 #3107
2024/09/01-17:59:16.834 7afc Delete type=3 #3106
2024/09/01-17:59:24.107 9128 Level-0 table #3111: started
2024/09/01-17:59:24.108 9128 Level-0 table #3111: 0 bytes OK
2024/09/01-17:59:24.109 9128 Delete type=0 #3109
2024/09/01-17:59:24.113 9128 Manual compaction at level-0 from '!scenes!i1noRqT20RD5stIK' @ 72057594037927935 : 1 .. '!scenes.walls!zksLSgRdh6f8jiUO.z5ptMNOLPqAgK6MH' @ 0 : 0; will stop at (end)
2024/09/01-17:59:24.113 9128 Manual compaction at level-1 from '!scenes!i1noRqT20RD5stIK' @ 72057594037927935 : 1 .. '!scenes.walls!zksLSgRdh6f8jiUO.z5ptMNOLPqAgK6MH' @ 0 : 0; will stop at (end)
2024/09/03-21:40:48.817 6180 Recovering log #3122
2024/09/03-21:40:48.821 6180 Delete type=0 #3122
2024/09/03-21:40:48.821 6180 Delete type=3 #3120
11 changes: 8 additions & 3 deletions packs/levels-samples/LOG.old
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2024/09/01-17:55:16.933 650c Recovering log #3105
2024/09/01-17:55:16.937 650c Delete type=0 #3105
2024/09/01-17:55:16.938 650c Delete type=3 #3104
2024/09/03-17:12:47.855 2ad4 Recovering log #3118
2024/09/03-17:12:47.859 2ad4 Delete type=0 #3118
2024/09/03-17:12:47.859 2ad4 Delete type=3 #3116
2024/09/03-17:15:30.223 3164 Level-0 table #3123: started
2024/09/03-17:15:30.223 3164 Level-0 table #3123: 0 bytes OK
2024/09/03-17:15:30.224 3164 Delete type=0 #3121
2024/09/03-17:15:30.232 3164 Manual compaction at level-0 from '!scenes!i1noRqT20RD5stIK' @ 72057594037927935 : 1 .. '!scenes.walls!zksLSgRdh6f8jiUO.z5ptMNOLPqAgK6MH' @ 0 : 0; will stop at (end)
2024/09/03-17:15:30.248 3164 Manual compaction at level-1 from '!scenes!i1noRqT20RD5stIK' @ 72057594037927935 : 1 .. '!scenes.walls!zksLSgRdh6f8jiUO.z5ptMNOLPqAgK6MH' @ 0 : 0; will stop at (end)
Binary file not shown.
File renamed without changes.
2 changes: 1 addition & 1 deletion packs/macros/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-003103
MANIFEST-003119
11 changes: 3 additions & 8 deletions packs/macros/LOG
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
2024/09/01-17:59:16.825 6494 Recovering log #3102
2024/09/01-17:59:16.828 6494 Delete type=0 #3102
2024/09/01-17:59:16.828 6494 Delete type=3 #3101
2024/09/01-17:59:24.106 9128 Level-0 table #3106: started
2024/09/01-17:59:24.106 9128 Level-0 table #3106: 0 bytes OK
2024/09/01-17:59:24.107 9128 Delete type=0 #3104
2024/09/01-17:59:24.113 9128 Manual compaction at level-0 from '!macros!2LfY4Ky5rRDkK7h8' @ 72057594037927935 : 1 .. '!macros!yx7Eb76rfzjh0LEO' @ 0 : 0; will stop at (end)
2024/09/01-17:59:24.113 9128 Manual compaction at level-1 from '!macros!2LfY4Ky5rRDkK7h8' @ 72057594037927935 : 1 .. '!macros!yx7Eb76rfzjh0LEO' @ 0 : 0; will stop at (end)
2024/09/03-21:40:48.804 5a0c Recovering log #3117
2024/09/03-21:40:48.807 5a0c Delete type=0 #3117
2024/09/03-21:40:48.807 5a0c Delete type=3 #3115
11 changes: 8 additions & 3 deletions packs/macros/LOG.old
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2024/09/01-17:55:16.915 5af0 Recovering log #3100
2024/09/01-17:55:16.919 5af0 Delete type=0 #3100
2024/09/01-17:55:16.920 5af0 Delete type=3 #3099
2024/09/03-17:12:47.849 4ef4 Recovering log #3113
2024/09/03-17:12:47.853 4ef4 Delete type=0 #3113
2024/09/03-17:12:47.853 4ef4 Delete type=3 #3111
2024/09/03-17:15:30.253 3164 Level-0 table #3118: started
2024/09/03-17:15:30.253 3164 Level-0 table #3118: 0 bytes OK
2024/09/03-17:15:30.254 3164 Delete type=0 #3116
2024/09/03-17:15:30.256 3164 Manual compaction at level-0 from '!macros!2LfY4Ky5rRDkK7h8' @ 72057594037927935 : 1 .. '!macros!yx7Eb76rfzjh0LEO' @ 0 : 0; will stop at (end)
2024/09/03-17:15:30.256 3164 Manual compaction at level-1 from '!macros!2LfY4Ky5rRDkK7h8' @ 72057594037927935 : 1 .. '!macros!yx7Eb76rfzjh0LEO' @ 0 : 0; will stop at (end)
Binary file not shown.
22 changes: 10 additions & 12 deletions scripts/handlers/sightHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,27 +277,26 @@ export class SightHandler {
* @param {Integer} collisionType - The collision type being checked: 0 for sight, 1 for movement, 2 for sound, 3 for light
* @returns {boolean} Whether the wall should be ignored
*/
static shouldIgnoreWall(wall, collisionType, options) {
if(!wall) return false;
const proximity = this.shouldIgnoreProximityWall(wall.document, options.A, options.B, options.source?.vision?.data?.externalRadius ?? 0);
static shouldIgnoreWall(wall, collisionType, options, edge) {
const {sight, light, sound, move} = edge;
const proximity = this.shouldIgnoreProximityWall(wall?.document, options.A, options.B, options.source?.vision?.data?.externalRadius ?? 0);
if (collisionType === 0) {
return (
wall.document.sight === CONST.WALL_SENSE_TYPES.NONE ||
sight === CONST.WALL_SENSE_TYPES.NONE ||
proximity ||
//wall.document.sight > 20 ||
(wall.document.door != 0 && wall.document.ds === 1)
(wall?.document?.door != 0 && wall?.document?.ds === 1)
);
} else if (collisionType === 1) {
return wall.document.move === CONST.WALL_MOVEMENT_TYPES.NONE || (wall.document.door != 0 && wall.document.ds === 1);
return move === CONST.WALL_MOVEMENT_TYPES.NONE || (wall?.document?.door != 0 && wall?.document?.ds === 1);
} else if (collisionType === 2) {
return wall.document.sound === CONST.WALL_MOVEMENT_TYPES.NONE || wall.document.sound > 20 || (wall.document.door != 0 && wall.document.ds === 1);
return sound === CONST.WALL_MOVEMENT_TYPES.NONE || sound > 20 || (wall?.document?.door != 0 && wall?.document?.ds === 1);
} else if (collisionType === 3) {
return wall.document.light === CONST.WALL_MOVEMENT_TYPES.NONE || wall.document.light > 20 || (wall.document.door != 0 && wall.document.ds === 1);
return light === CONST.WALL_MOVEMENT_TYPES.NONE || light > 20 || (wall?.document?.door != 0 && wall?.document?.ds === 1);
}
}

static shouldIgnoreProximityWall(document, source, target, externalRadius = 0) {
if (!source || !target) return false;
if (!source || !target || !document) return false;
const d = document.threshold?.sight;
if (!d || d.sight < 30) return false; // No threshold applies
const proximity = document.sight === CONST.WALL_SENSE_TYPES.PROXIMITY;
Expand Down Expand Up @@ -414,10 +413,9 @@ export class SightHandler {
const rectW = Math.abs(x1 - x0);
const rectH = Math.abs(y1 - y0);
const rect = new PIXI.Rectangle(rectX, rectY, rectW, rectH);
const walls = canvas.walls.quadtree.getObjects(rect);
let terrainWalls = 0;
for (const [k, edge] of canvas.edges) {
if (this.shouldIgnoreWall(edge.object, TYPE, options)) continue;
if (this.shouldIgnoreWall(edge.object, TYPE, options, edge)) continue;
if (IGNOREDARKNESS && edge.type === "darkness") continue;
let isTerrain = (TYPE === 0 && edge.sight === CONST.WALL_SENSE_TYPES.LIMITED) || (TYPE === 1 && edge.move === CONST.WALL_MOVEMENT_TYPES.LIMITED) || (TYPE === 2 && edge.sound === CONST.WALL_MOVEMENT_TYPES.LIMITED) || (TYPE === 3 && edge.light === CONST.WALL_MOVEMENT_TYPES.LIMITED);

Expand Down

0 comments on commit 2b9aed1

Please sign in to comment.