B
bleeze
Guest
So i've made a 2d array with enum variables for my items in my game. One of the enums is for amount, which tracks how many you have of each item. The problem is when i remove an item, with the simple code:
itemdef [ itemtype, itemprop.amount ] - = 1;
It jumps straigth to -1, even if you have several of an item. But get this, if i keep removing items it works properly, going from -1 to -2 and so on. I think when i call it the first time, it goes from x amount to it's original amount which is 0. Have i misunderstood the use of enums? Is there anyway to do this with enums, or do I need to change it to something else? Any advice is appreciated.
itemdef [ itemtype, itemprop.amount ] - = 1;
It jumps straigth to -1, even if you have several of an item. But get this, if i keep removing items it works properly, going from -1 to -2 and so on. I think when i call it the first time, it goes from x amount to it's original amount which is 0. Have i misunderstood the use of enums? Is there anyway to do this with enums, or do I need to change it to something else? Any advice is appreciated.