pets: fix bug that food not getting added to

This commit is contained in:
Tyler Renelle
2013-03-23 00:09:05 -06:00
parent 3c75caffd8
commit 68bc02af72
+2
View File
@@ -114,12 +114,14 @@ score = (model, taskId, direction, times, batch, cron) ->
if direction is 'up' and obj.flags.dropsEnabled and Math.random() < .5
if Math.random() < .5
drop = randomVal(food)
obj.items.food ?= []
obj.items.food.push drop.name
batch.set 'items.food', obj.items.food
drop.type = 'Food'
drop.dialog = "You've found #{drop.text} Hatching Powder! #{drop.notes}"
else
drop = randomVal(pets)
obj.items.food ?= []
obj.items.eggs.push drop
batch.set 'items.eggs', obj.items.eggs
drop.type = 'Egg'