• 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] [vJASS] Destroying Structs

Status
Not open for further replies.
Level 16
Joined
Mar 3, 2006
Messages
1,564
JASS:
struct Data
integer HL
integer CL
integer Diff
static item IDropped
method ItemDrop takes nothing returns nothing
local Data dat = Data.allocate()
set IDropped = ItemSet[dat.HL][dat.CL + dat.Diff]
if IDropped == <ITEM_ID> then
dat.destroy
endmethod
 
method onDestroy takes nothing returns nothing
set IDropped = null
endmethod

This is just an example, but what I want to know is that onDestroy is called when I say dat.destroy

Or the question in another word how to destroy structs is it by calling the function onDestroy or writing dat.destroy in the script ?
 
Status
Not open for further replies.
Top