Dr_Nomz
Member
So I have this code, which works fine, but the one thing that doesn't work is if there isn't any ammo leftover.
See the code is like this:
That runs the code, but if n isn't over 0, (like at 0) shouldn't it run that code in the ELSE statement? Or am I not understanding how this code works?
See the code is like this:
Code:
if (global.inventory[i] == 7){
n = min(global.inventory_count[i],500-global.equip_count[0],500);
if n > 0 {
global.inventory_count[i] -= n;
global.equip_count[0] += n;
}else //<<<<Important Part
sound_play(snd_Empty);
}