Is there anything in here that could potentially cause a crash?
The method prints the struct 'contents' of a linked list of objects (which works properly: I can add to the end of the list and remove at an arbitrary position without problems. nextobject is 0 for the last element in the list). I called the method like so:
Warcraft crashed at the second .display() call. Any ideas why?
Also, I replaced the TSA with a timer, and the same thing happened.
JASS:
static method display takes unit subject returns nothing
local object o = .Objects[GetUnitIndex(subject)] // GetUnitIndex() is working fine. Objects is a normal, static struct array.
local string final = ""
loop
set final = final + " -> " + I2S(integer(o))
exitwhen o.nextobject == 0
set o = o.nextobject
endloop
call BJDebugMsg(final + "\n")
endmethod
The method prints the struct 'contents' of a linked list of objects (which works properly: I can add to the end of the list and remove at an arbitrary position without problems. nextobject is 0 for the last element in the list). I called the method like so:
JASS:
private function Actions takes nothing returns nothing
// Insertion into the linked list, etc.
// ...
call object.display(subject)
call TriggerSleepAction(3.)
call object.display(subject)
endfunction
Warcraft crashed at the second .display() call. Any ideas why?
Also, I replaced the TSA with a timer, and the same thing happened.