Weep
Godspeed to the sound of the pounding
- Reaction score
- 400
Will this cause any problems I don't know about? Like, will it pollute the string table or anything?
I am, of course, aware of the obvious (taking a lot of computation to do something simple: avoiding having to update the rawcode for an ability every time you paste into a new map, without having ObjectMerger available).
I am, of course, aware of the obvious (taking a lot of computation to do something simple: avoiding having to update the rawcode for an ability every time you paste into a new map, without having ObjectMerger available).
JASS:
globals
integer start = 039;A000039;
integer end = 039;A500039;
endglobals
globals//locals
integer index = 0
string goalName = ""
integer result = 0
endglobals
function FindAbilityNewThread takes nothing returns nothing
local integer i = index+250
loop
exitwhen index == i
if GetObjectName(index) == goalName then
set result = index
exitwhen true
endif
set index = index+1
endloop
endfunction
function FindAbilityByName takes string abilName returns integer
local trigger t = CreateTrigger()
local triggeraction a = TriggerAddAction(t, function FindAbilityNewThread)
set index = start
set result = 0
set goalName = abilName
loop
exitwhen result > 0 or index > end
call TriggerExecute(t)
endloop
call TriggerRemoveAction(t, a)
call DestroyTrigger(t)
set t = null
set a = null
return result
endfunction