Skip to content

Commit

Permalink
Handle darkness sources
Browse files Browse the repository at this point in the history
  • Loading branch information
Eligarf committed Jul 2, 2024
1 parent 7917c2c commit 812c814
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v4.4.1
* Update pt-BR.json (thanks Kharmans)
* Handle darkness sources properly

# v4.4.0
* dnd5e: *Hiding* Status Effect can be used to bank stealth results (Foundry v12/dnd5e v3.2 only)
* dnd5e: Handle vision-5e's "undefined" detection mode
Expand Down
3 changes: 2 additions & 1 deletion scripts/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,9 @@ export default class Engine {
// }

let lights = scene.lights
.map(light => light._object?.source)
.map(light => beforeV12 ? light._object?.source : light._object?.lightSource)
.concat(scene.tokens.filter(t => t.object?.light?.active).map(t => t.object.light))
.filter(light => !((beforeV12) ? light.isDarkness : light instanceof foundry.canvas.sources.PointDarknessSource))
.filter(light => light?.shape?.contains(center.x, center.y));
// .filter(light => distSquared(center, light, token.document.elevation, light.elevation) < light.data.dim * light.data.dim);

Expand Down

0 comments on commit 812c814

Please sign in to comment.