hi guys, i'm having a problem with my game involving my inventory. I'm trying to fix a bug that when I go to craft a new item, in addition to spending the materials, the item is not created because the inventory is full, so to fix this I had an idea, to check if there is space, and if there is, it runs the crafting code but here comes the problem. I made the code like this:
the problem with this function I made is that it's not returning correctly, I don't know if that was clear but the problem is that I can't return the inventory value, if there really is an item there or not and that's what I'd like to help, how can i see if there is value there or not? I tried using Ds_list_find_valor() but it gives the same problem. I appreciate any help or tip.
GML:
function scr_check_inv(){
var list_ = global.invlist;
var list_size = ds_list_size(list_)
for(var i = 0; i < list_size; i++)
{
var _arr = list_[| i];
if(_arr != 1)
{
//if I'm going through the inventory, and I have
//everyone busy, i come back true
return true;
}
}
}