Lightning effects causing crashes

Darius34

New Member
Reaction score
30
Under what circumstances exactly do lightning effects cause crashes? Destroying them twice over, referencing them after destroyed/nulled, etc.?

This would help me a lot with debugging this extra-large trigger I'm working on (at least, it would give me some direction). Thanks.
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
Stretching a lightning effect too far can cause crashes.
 

Darius34

New Member
Reaction score
30
Hmm, okay. Is there any way to check if a lightning effect was destroyed, like checking if it contains a null value?
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
I don't think objects are nulled when destroyed. You would have to null the reference for it to be null... I think... Otherwise there probably wouldn't be too much of a need for nulling variables, right? (I have not verified this, if someone can prove me wrong or addon to this, be my guest!)

I have ran a few tests with results that may prove the above, but I am not sure since it was so long ago. :p
 

Darius34

New Member
Reaction score
30
Have you tried that?
Yes, but with the crash always happening, and I haven't really checked if that bit of works. I'll check.

Maybe I could null the variable? I'm using a struct to reference the lightning, so I could check for it being nulled in the scope... Maybe.
 

emjlr3

Change can be a good thing
Reaction score
395
i hoope that shows not null
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
i hoope that shows not null

Yes, it does.

JASS:
function Actions takes nothing returns nothing
    local location l = Location(0, 0)
    call RemoveLocation(l)
    if l == null then
          call BJDebugMsg("null")
    else
          call BJDebugMsg("not null")
    endif 
endfunction

function InitTrig_Trig takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterTimerEvent(t,3,false)
    call TriggerAddAction(t,function Actions)
endfunction


It displays "not null".
 

Darius34

New Member
Reaction score
30
Good news! I nulled the variable upon the lightning effect being destroyed and voila, that null-check worked. After a bit of debugging with NewGen WC (and war3err, I presume, right), I fixed the problem: a wrong struct reference somewhere that caused a divide-by-zero error. >.>

Thanks for the help, everyone.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top