- Joined
- Aug 7, 2013
- Messages
- 1,338
Hi,
Suppose we have 2 libraries, A and B.
Library B requires Library A, as Library A fills up a special table that B needs to do its work correctly.
and our second library
So, even though B requires A, somehow B's init fires off before A fills up its data structure. This is impossible given the documentation I've read, which promises that all of B's work, etc. will be started only AFTER A.
Or is the timer somehow messing things up? (should be in manual...)
Suppose we have 2 libraries, A and B.
Library B requires Library A, as Library A fills up a special table that B needs to do its work correctly.
JASS:
library A initializer init
globals
integer array INTS[5]
endglobals
private function main takes nothing returns nothing
set INTS[0] = -555
endfunction
private function init takes nothing returns nothing
local timer t = CreateTimer()
call StartTimer(t, 1.0, false, function main)
endfunction
endlibrary
and our second library
JASS:
library B initializer init requires A
globals
endglobals
private function init
call print(I2S(INTS[0])) //this should print "-555"
//instead it prints "0"
endfunction
endlibrary
So, even though B requires A, somehow B's init fires off before A fills up its data structure. This is impossible given the documentation I've read, which promises that all of B's work, etc. will be started only AFTER A.
Or is the timer somehow messing things up? (should be in manual...)