From 68edf3ff452f4490040c2d64937924be9cb8193e Mon Sep 17 00:00:00 2001 From: MrYawnie Date: Sat, 18 Jul 2020 17:32:54 +1000 Subject: [PATCH] clean up code changed to return early pattern for consistency Co-authored-by: Moppler <48440667+Moppler@users.noreply.github.com> --- src/js/game/hub_goals.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/js/game/hub_goals.js b/src/js/game/hub_goals.js index c2222d5a..99b37fd2 100644 --- a/src/js/game/hub_goals.js +++ b/src/js/game/hub_goals.js @@ -217,14 +217,15 @@ export class HubGoals extends BasicSerializableObject { required: 1, reward: enumHubGoalRewards.no_reward_freeplay, }; - } else { - this.currentGoal = { - /** @type {ShapeDefinition} */ - definition: this.createRandomShape(), - required: 10000 + findNiceIntegerValue(this.level * 2000), - reward: enumHubGoalRewards.no_reward_freeplay, - }; + return; } + this.currentGoal = { + /** @type {ShapeDefinition} */ + definition: this.createRandomShape(), + required: 10000 + findNiceIntegerValue(this.level * 2000), + reward: enumHubGoalRewards.no_reward_freeplay, + }; + return; } /**