Make compatbile with the Arms Reach module

This commit is contained in:
2021-02-10 11:06:03 +01:00
parent f905657e41
commit 6b36b62e71
4 changed files with 6 additions and 13 deletions

View File

@@ -2,7 +2,8 @@ import {settingsKey} from "../settings.js"
// Toggles between normal and secret doors
export function onDoorLeftClick(event) {
if (game.settings.get(settingsKey, "toggleSecretDoors") && event.data.originalEvent.ctrlKey && game.user.isGM) {
// We don't trust the event to be filled with the expected data for compatibilty with arms reach (which passes a broken event)
if (game.settings.get(settingsKey, "toggleSecretDoors") && event.data?.originalEvent?.ctrlKey && game.user.isGM) {
const types = CONST.WALL_DOOR_TYPES
const newtype = this.wall.data.door === types.DOOR ? types.SECRET : types.DOOR
this.wall.update({door: newtype})