• 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.

[JASS] Small question on jass effects usage

Status
Not open for further replies.
Level 13
Joined
May 24, 2005
Messages
609
Hey there,

I've got just a small question on jass effect coding:

As we all know, effect variables have to be nullified.
So my default way of using them is like this (for non permanent and temporary effects, like for spells):

JASS:
local effect e
set e = AddSpecialEffectTarget(...)
call DestroyEffect(e)
set e = null

But what about the second alternative posted below? It seems to do the same, it doesn't need a local variable and is overall much shorter:

JASS:
call DestroyEffect(AddSpecialEffectTarget(...))

My question: Is the second way also a good and clean way for using effects?
I think so but I'm not completely sure..

Thanks!
 
Status
Not open for further replies.
Top