mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
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:
@@ -28,9 +28,10 @@
|
||||
var/totalFlavor = 0
|
||||
for(var/taste in data)
|
||||
totalFlavor += data[taste]
|
||||
for(var/taste in data)
|
||||
if(data[taste]/totalFlavor < 0.1)
|
||||
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
|
||||
|
||||
/datum/reagent/nutriment/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
if(!injectable)
|
||||
|
||||
Reference in New Issue
Block a user