Always check first if a feature is enabled before doing anything else to increase compatibility with other modules

This commit is contained in:
2021-01-27 12:43:47 +01:00
parent 2a9d7e7acb
commit 869fedd128
4 changed files with 10 additions and 5 deletions

View File

@@ -26,13 +26,13 @@ export function onRenderChatMessage(message, html, data) {
// Creates a chat message stating that a player tried to open a locked door
export function onDoorLeftClick() {
const state = this.wall.data.ds
const states = CONST.WALL_DOOR_STATES
// Check if this feature is enabled
if (!game.settings.get(settingsKey, "lockedDoorAlert"))
return false
const state = this.wall.data.ds
const states = CONST.WALL_DOOR_STATES
// Only create messages when the door is locked.
if (state != states.LOCKED)
return false