View Single Post
Old 08-24-2009, 05:30 PM   #1
Join Date: Aug 2003
Posts: 104

marshall has little to show at this moment (1)

Question Most effienct way of referencing a unit = ?

I want my map to be as efficient as possible in the basic code (not worrying about systems here, just plain Jass). I've searched around for tips on this but am not completely sure what the pros/cons are of the following snippets of code. Would someone mind pointing out the pros/cons of each of the following in terms of efficiency? Thanks.

Method A
Collapse JASS:
set udg_MyUnitArray[94] = GetTriggerUnit()
call PauseUnit(udg_MyUnitArray[94], true)
call IssueImmediateOrder(udg_MyUnitArray[94], "stop")
call PauseUnit(udg_MyUnitArray[iDynamic], false)

Method B
Collapse JASS:
local unit uTemp = GetTriggerUnit()
set udg_MyUnitArray[94] = uTemp
call PauseUnit(uTemp, true)
call IssueImmediateOrder(uTemp, "stop")
call PauseUnit(uTemp, false)
set uTemp = null

Method C
Collapse JASS:
set udg_MyUnitArray[94] = GetTriggerUnit()
call PauseUnit(GetTriggerUnit(), true)
call IssueImmediateOrder(GetTriggerUnit(), "stop")
call PauseUnit(GetTriggerUnit(), false)
marshall is offline   Reply With Quote
Sponsored Links - Login to hide this ad!