• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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