HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Would this work?

08-03-2007, 08:20 PM#1
Beardo
Collapse JASS:
globals
unit array heros
string array herotable
endglobals

function RanWhenHeroIsSelected takes unit u returns nothing
local integer id = GetPlayerId(GetOwningPlayer(u))

set heros[id]      = u
set herotable[id]  = GetAttachmentTable(u)
endfunction

Would that get around running 'GetAttachmentTable()' whenever you need to acess a players heros attached vars?

PS Yes I know this is not MUI.
08-03-2007, 08:45 PM#2
blu_da_noob
That would allow you to use herotable[GetPlayerId(GetOwningPlayer(unit))] instead of GetAttachmentTable(unit), yes. As long as you only have one hero per player.
08-03-2007, 08:46 PM#3
Beardo
thanks