lasers = erase(lasers, laserid)
Yeah already fixed this :facepalm: It works now, but causes an error sometimes and crashes danmakufu. I smell erase decreases length of an array causing other later erases go out of bounds :qq:
Oh well. I've got it. Looks like i dont need to erase an array entry from the task, but while parsing it for laser data comparsion.
Just one question: what will array cell contain when i call Obj_Delete in task? NULL? Screw this. I forgot about Obj_BeDeleted function.
But damn again it causes error 126 and crashes danmakufu. Here's the task testing this
task ParseLasers{
let num=0;
loop{
num=length(lasers);
if (num>1){
ascent(i in 1..num){
if(Obj_BeDeleted(lasers[i])){
lasers=erase(lasers,i);
num--;
}
}
}
yield;
}
}
I'm curious, does decreasing of
num affect ascent, or should i use while?
UPD: Just as planned! Replacing
ascent (i in 1..num) with
while (i<num) fixes the problem. Maaan, make another note on danmakufu weird bugs list
Oh and it's so fun to answer own questions in the thread yourself