• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] How to remove lightning?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

I have been using the native DestroyLightning(...) but it doesn't do anything apparently (the lightning doesn't go away). Here is the relevant code.

JASS:
...
       set bolts[0] = AddLightningEx("FORK", false, minX, minY, 0.0, minX, maxY, 0.0)
       set bolts[1] = AddLightningEx("FORK", false, maxX, minY, 0.0, maxX, maxY, 0.0)
       set bolts[2] = AddLightningEx("FORK", false, minX, minY, 0.0, maxX, minY, 0.0)
       set bolts[3] = AddLightningEx("FORK", false, minX, maxY, 0.0, maxX, maxY, 0.0)

...

        local integer i = 0
        loop
            exitwhen i == BOLTS_PER_RECT
            call DestroyLightning(bolts[i])
            set bolts[i] = null
            set i = i + 1
        endloop

Any reason why those pesky lightnings won't disappear?
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
The code worked...what happened was I was creating an extra set of lightning effects exactly over those ones, but I didn't remove the second set, so it almost looked like the lightning stayed...just me being not careful.
 
Status
Not open for further replies.
Top