FlushParentHashtable "trouble"

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
What does FlushParentHashtable native actually do? I thought it just clears/flushes whatever was in the hashtable passed as an argument but it seams it renders it unusable.

JASS:

globals
    hashtable ht = InitHashtable()
endglobals
    
function test_flush_parent_hashtable takes nothing returns nothing
    call SaveInteger(ht, 0, 0, 100)
    call BJDebugMsg(I2S(LoadInteger(ht, 0, 0))) // displays 100 (no surprise)
    
    call FlushParentHashtable(ht)
        
    call SaveInteger(ht, 1, 1, 200)
    call BJDebugMsg(I2S(LoadInteger(ht, 1, 1))) // displays 0? why??
endfunction 

function InitTrig_test takes nothing returns nothing
    call test_flush_parent_hashtable()
endfunction
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
Hm... well that's strange. But I guess I shouldn't be surprised because Blizzard made
hashtables to replace "the good old" gamecache and with them you also need to reinit
it after flushing (FlushGameCache).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top