From 93d117100ab36a92330ef7c5b9b6ad81e69a0bff Mon Sep 17 00:00:00 2001 From: gosnat Date: Mon, 5 May 2014 13:22:57 -0500 Subject: [PATCH 1/2] Update GoalManager.coffee For compound goals like GetAllToLocation, you should continue adding to the existing list of thang states. --- app/lib/world/GoalManager.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/world/GoalManager.coffee b/app/lib/world/GoalManager.coffee index 073e87b05..cc31a61bf 100644 --- a/app/lib/world/GoalManager.coffee +++ b/app/lib/world/GoalManager.coffee @@ -204,7 +204,7 @@ module.exports = class GoalManager extends CocoClass arrays = (prop for prop in whos when prop?.length) return unless arrays.length - state[progressObjectName] = {} + state[progressObjectName] = state[progressObjectName] ? {} for array in arrays for thang in array if @thangTeams[thang]? From acccee33a37103a8664e66dd9371fd83b5fa324b Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Tue, 6 May 2014 07:22:09 -0700 Subject: [PATCH 2/2] Cleaner conditional init syntax. --- app/lib/world/GoalManager.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/world/GoalManager.coffee b/app/lib/world/GoalManager.coffee index cc31a61bf..ea13e4188 100644 --- a/app/lib/world/GoalManager.coffee +++ b/app/lib/world/GoalManager.coffee @@ -204,7 +204,7 @@ module.exports = class GoalManager extends CocoClass arrays = (prop for prop in whos when prop?.length) return unless arrays.length - state[progressObjectName] = state[progressObjectName] ? {} + state[progressObjectName] ?= {} for array in arrays for thang in array if @thangTeams[thang]?