From 22b850f1c0d2c56035f7b5ba5ea090d1330902dc Mon Sep 17 00:00:00 2001 From: Matt Rasmus Date: Wed, 10 Jul 2013 12:29:17 -0700 Subject: [PATCH] outside.js: Fix incorrect display of workers. Fixed an issue where the workers view would break temporarily if all the villagers were killed. --- script/outside.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/outside.js b/script/outside.js index b840f70..23daebd 100644 --- a/script/outside.js +++ b/script/outside.js @@ -252,8 +252,12 @@ var Outside = { }, updateWorkersView: function() { - if(State.outside.population == 0) return; var workers = $('div#workers'); + + // If our population is 0 and we don't already have a workers view, + // there's nothing to do here. + if(!workers.length && State.outside.population == 0) return; + var needsAppend = false; if(workers.length == 0) { needsAppend = true;