You mention in the example "Is removed because 8 is there twice". As far as i looked that code, I didnt get wether you meant that you yourself decided to remove the second 8 (spot 7 being number 8 with starting from 0 logic), or if you meant that the example program was somehow checking if there were doubles and removed the other.
Change them to using a,b,c,d,e,f,g,h,h,i and number 7 rather than using numbers twice, that makes it condusing.
Anyway, my problem is following. after hour of bug hunting, i found out this is the problem spot.
I have this piece of code:
Code: Select all
RemoveItem(at.tasks, n)
at.tasks is a table holding tables ie.
Code: Select all
at.tasks[1] = {stuff}
at.tasts[2] = {stuff}
At this crash point only one table exists in this at.tasks table, the table at.tasks[1] and n is 1.
So effectively it shoud destroy the at.tasks[1] table out.
However, this does not happen.
I have tried following:
Code: Select all
RawGet(at.tasks, 2) - Not true
RawGet(at.tasks, 1) - True
RemoveItem(at.tasks, 1) - I see no reason why this would fail, so i suppose it happened
RawGet(at.tasks, 1) - True
How is it possible that right after checking that there is no other at.tasks[n] tables existing (checking number 2 and it failing) and checking that number 1 indeed exists, then how come when i delete number 1 out, and right after that in next line check if its existing, it tells me it does exist?
Shouldnt it have been removed, or did i misunderstand something about this command?