mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 19:52:40 +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,6 +28,7 @@
|
|||||||
var/totalFlavor = 0
|
var/totalFlavor = 0
|
||||||
for(var/taste in data)
|
for(var/taste in data)
|
||||||
totalFlavor += data[taste]
|
totalFlavor += data[taste]
|
||||||
|
if(totalFlavor) //Let's not divide by zero for things w/o taste
|
||||||
for(var/taste in data)
|
for(var/taste in data)
|
||||||
if(data[taste]/totalFlavor < 0.1)
|
if(data[taste]/totalFlavor < 0.1)
|
||||||
data -= taste
|
data -= taste
|
||||||
|
|||||||
Reference in New Issue
Block a user