HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

var!=null = thread freeze?

06-16-2006, 03:31 PM#1
vile
Code:
    local destructable d
    local integer i=1
    local unit ent
    call BJDebugMsg("try")
    loop
        exitwhen i>10 or d!=null
    call BJDebugMsg("wtf1")

"wtf1" never happens

wtf?

It works if i remove the d!=null

I dont get it.
06-16-2006, 03:36 PM#2
Vexorian
d is not initialized

when you don't actually initialize variables they make threads crash

local destructable d=null
06-16-2006, 03:37 PM#3
aquilla
that's an infinite loop (= exit function), you forgot to set i = i+1 :P
06-16-2006, 03:48 PM#4
Vexorian
I think he didn't add the rest of the code :P notice there wasn't even an endloop
06-16-2006, 03:59 PM#5
vile
I didnt add the rest of the code

Hmm, vex, im gonna try it right away

hold on.

edit:
thanks, it works. another important thing to learn.
06-16-2006, 04:25 PM#6
blu_da_noob
Whenever you use an uninitialised variable in anything except an assignment, the thread stops. (Clarifying Vex's statement)
06-16-2006, 10:57 PM#7
vile
Actually, you just repeated exactly what he said.
06-16-2006, 11:57 PM#8
Jazradel
Except I understood what blu meant.
06-17-2006, 09:50 AM#9
Blade.dk
http://www.wc3campaigns.net/misc.php?do=bbcode#jass
06-17-2006, 11:06 AM#10
BertTheJasser
Vex is totally right. I exoirienced this problem on myself. I actually rewrote 2 hole spells unitil I got, why they did not work.