To start, I'm well aware that there have been many similar questions, trust me, I wouldn't have gone through the effort of making an account if I hadn't check those first. I've been coding on Python for around 3 years so I'm no stranger to programming logic, here's the code:
digest (FoodItem) {
uk = upkeep();
x = this.fullness + FoodItem.filling;
y = this.Capacity + FoodItem.filling * 0.5;
if (x>y) {
return "Can't eat this"
};
else {
this.fullness = x;
z = 1;
if (this.fullness > this.Saturation) {
z = 1 + (this.fullness - this.Saturation)*0.1;
z = z.toFixed(1);
};
if (this.quota < uk) {
this.quota = this.quota + FoodItem.mass * z;
};
else {
...;
};
};
};
Now, I know that removing the second else doesn't solve the issue so the main problem lies with the first one, I think but as to why it's not working I have no idea.