• 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] SaveUnitHandle bug

Status
Not open for further replies.
I have these lines:

JASS:
    call SaveUnitHandle( udg_hashtable, GetHandleId(orderunit), udg_BatalionHash_TargetUnit, null )
    
    set orderunit = LoadUnitHandle( udg_hashtable, GetHandleId(orderunit), udg_BatalionHash_TargetUnit )
    call BJDebugMsg(GetUnitName(orderunit))

I get output with a unit name which was recently targeted, even though I nullified its handle in hashtable. I can store another unit, but I can't empty it for some reason. :S
 
How can I flush them? It clears the whole hashtable?

Xonok is correct. Simply use:
JASS:
native  RemoveSavedHandle                                       takes hashtable table, integer parentKey, integer childKey returns nothing

e.g.:
JASS:
call RemoveSavedHandle( udg_hashtable, GetHandleId(orderunit), udg_BatalionHash_TargetUnit)

And that will clear up the reference in the hashtable.
 
Status
Not open for further replies.
Top