js/sightLayerUpdate.js
/*
  * Checks mask opacity at location of placeable and sets visibility
  */
Checks mask opacity at location of placeable and sets visibility
Checks mask opacity at location of placeable and sets visibility
function _setPlaceableVisibility(placeable) {
  if (placeable.observer && !game.user.isGM) return;
  const pos = _getCanvasCoords(placeable);
  const p = readPixel(canvas.simplefog.maskTexture, pos.x, pos.y);
  const pAvg = (p[0] + p[1] + p[2]) / 3;
  const v = ((pAvg / 255) < canvas.scene.getFlag('simplefog', 'vThreshold'));
  if (placeable.data.door) placeable.doorControl.visible = v;
  else placeable.visible = v;
}
function _setPlaceableVisibility ( placeable ) { if ( placeable . observer && ! game . user . isGM ) return ; const pos = _getCanvasCoords ( placeable ) ; const p = readPixel ( canvas . simplefog . maskTexture , pos . x , pos . y ) ; const pAvg = ( p [ 0 ] + p [ 1 ] + p [ 2 ] ) / 3 ; const v = ( ( pAvg / 255 ) < canvas . scene . getFlag ( 'simplefog' , 'vThreshold' ) ) ; if ( placeable . data . door ) placeable . doorControl . visible = v ; else placeable . visible = v ; }
Checks mask opacity at location of placeable and sets visibility
Checks mask opacity at location of placeable and sets visibility
// if this is a door, we set vis on it's control object instead