• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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