Code: Select all
DebugPrint("status1 :"..wave.enemytable[1].status)
p_InitializeEnemy(wave.enemytable[0])
DebugPrint("status2 : "..wave.enemytable[1].status)
Function p_InitializeEnemy(enemy)
enemy.status=1
EndFunction
When program gets to first debuprin place, it continues to this function, and there is nothing else but this one line (i removed all the rest) and then it jump directly back to next debugprint.
But a strangest thing happens.
In first debugrpint, status = 2, but in second debugprint, status = 1?
I am sending item[0] there, yet changing item 0.status to 1, changes also every other items status to 1? Why?
I also tried changing enemy into enemmy in case there was some global table there doing something, but no use.
effit: also changing 0 and 1 to 1 and 2 make no difference, so it doesnt have to do with 0 table chagning all only.