message: added comments to explain what the function does
diff: -setup.weightedRandomFetcher = function (town, args, npc, fn) {
  +setup.weightedRandomFetcher = function (town, args, obj, fn, defaultProbability) {
  // console.log(args)
  + if (!defaultProbability) {
  + defaultProbability = 10
  + }
  + // town is needed because everything needs town to evaluate
  + // args is the object containing the objects that you're drawing from
  + // obj is the optional npc, building, or whatever that is needed for functions.
  + // fn is the optional exclusion testing function. Leave blank if everyting in your object is always going to be allowed.
  + // defaultProbability is the optional default unit. You won't usually need to supply this.
  var pool = []
  var totalWeight = 0
  fn = fn || true
  - // console.log('function: ')
  - // console.log(fn)
  - // function addWeight (totalWeight, value) {
  - // totalWeight += value
  - // }
  +
  for (var arg in args) {
  // console.log(args[arg])
  if (typeof (args[arg].exclusions) === 'function') {
  - var isValid = args[arg].exclusions(town, npc)
  + var isValid = args[arg].exclusions(town, obj)
  } else {
  isValid = true
  }
  @@ -26,9 +30,7 @@ setup.weightedRandomFetcher = function (town, args, npc, fn) {
  // console.log(fnValid)
  if (isValid === true && fnValid === true) {
  pool.push(args[arg])
  - // console.log('probability: ' + args[arg].probability)
  - // addWeight.apply(totalWeight, [args[arg].probability])
  - totalWeight += args[arg].probability || 5
  + totalWeight += args[arg].probability || defaultProbability
  }
  // isValid = {}
  }
  @@ -36,7 +38,7 @@ setup.weightedRandomFetcher = function (town, args, npc, fn) {
  var random = Math.floor(randomFloat(1) * totalWeight)
  console.log(random)
  for (var i = 0; i < pool.length; i++) {
  - random -= pool[i].probability || 5
  + random -= pool[i].probability || defaultProbability
  if (random < 0) {
  // console.log('Less than zero! Found one.')
  // console.log(pool[i])
  @@ -44,6 +46,6 @@ setup.weightedRandomFetcher = function (town, args, npc, fn) {
  break
  }
  }
  - console.log(selected.function(town, npc))
  - return selected.function(town, npc)
  + console.log(selected.function(town, obj))
  + return selected.function(town, obj)
  }
  