Fix runtime while eating

Don't divide by zero. If it has no flavors, this stays 0, then you try to divide by it.
This commit is contained in:
Arokha Sieyes
2017-03-21 13:07:00 -04:00
parent 7d1245d180
commit e6098840ec

View File

@@ -28,6 +28,7 @@
var/totalFlavor = 0
for(var/taste in data)
totalFlavor += data[taste]
if(totalFlavor) //Let's not divide by zero for things w/o taste
for(var/taste in data)
if(data[taste]/totalFlavor < 0.1)
data -= taste