Thread: PUI 6.0
View Single Post
Old 12-06-2011, 08:00 AM   #2
Bribe
User
 
Bribe's Avatar
 
Join Date: Mar 2010
Posts: 233

Submissions (1)

Bribe will become famous soon enough (30)Bribe will become famous soon enough (30)

Send a message via AIM to Bribe
Default

This should have optional support for hashtable.

The "create" method leaks indices in some cases in DEBUG_MODE. To fix this you can revise it (and shorten it) to:
Collapse JASS:
    static method create takes unit whichUnit returns UnitIndex
        local UnitIndex index 
        
        // check for invalid unit handle
        debug if GetUnitTypeId(whichUnit) == 0 then
        debug     call BJDebugMsg("|c00FF0000ERROR: PUI - Index requested for invalid unit")
        debug     return 0
        debug endif
        
        set index = UnitIndex.allocate()
        set index.u = whichUnit
        call SetUnitUserData(whichUnit, index)
        
        return index
    endmethod

Why using a trigger for the timer, instead of just a normal timer?

PUI_PROPERTY is nice... if you are using just ONE piece of data. I don't even think it has a purpose otherwise.
Bribe is offline   Reply With Quote