我做了一个库存系统(其他是drop),这是提货代码
// pickup
found_in_inv = false;
for(var i = 0; i < ds_list_size(global.inv); i++){
if(global.inv[| i][| 0] == other.object_index){ // error line
global.inv[| i][| 1]++;
found_in_inv = true;
break;
}
}
if(found_in_inv){
instance_destroy(other);
}else{
for(var i = 0; i < ds_list_size(global.inv); i++){
if(global.inv[| i][| 0] == noone){
global.inv[| i][| 0] = other.object_index;
global.inv[| i][| 1] = 1;
break;
instance_destroy(other);
}
}
}
我收到一个语法错误,其中“[|” 发现,“)”预期。我不知道如何解决这个问题,请帮助。