From 083ee3bfa370785f75dd9fa663cfbb2e8b60ff71 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sun, 13 Jan 2019 12:59:37 -0500 Subject: [PATCH] Removed unnecessary check --- satiate.js | 1 - world.js | 16 ++++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/satiate.js b/satiate.js index c39ad43..bddc461 100644 --- a/satiate.js +++ b/satiate.js @@ -83,7 +83,6 @@ function init(story) { initWorld(story, state); initAudio(story, state); initGame(story, state); - resetControls(state); story.intro.setup(state); diff --git a/world.js b/world.js index 951067c..92a34b4 100644 --- a/world.js +++ b/world.js @@ -53,17 +53,13 @@ function resetControls(state) { actionButtons = []; - if (state.player.location) { - if (state.world[state.player.location].actions) { - state.world[state.player.location].actions.forEach(action => { - actionButtons.push(undefined); - }); - } - } - - - + const actions = state.world[state.player.location].actions; + if (actions) { + actions.forEach(action => { + actionButtons.push(undefined); + }); + } }