Always check first if a feature is enabled before doing anything else to increase compatibility with other modules
This commit is contained in:
@@ -2,7 +2,7 @@ import {settingsKey} from "../settings.js"
|
||||
|
||||
// Toggles between normal and secret doors
|
||||
export function onDoorLeftClick(event) {
|
||||
if (event.data.originalEvent.ctrlKey && game.user.isGM && game.settings.get(settingsKey, "toggleSecretDoors")) {
|
||||
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})
|
||||
|
||||
Reference in New Issue
Block a user