// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1367 globals // integer PLAYER_NEUTRAL_PASSIVE=0 // integer PLAYER_NEUTRAL_AGGRESSIVE=0 // unitstate UNIT_STATE_MANA=null // playerevent EVENT_PLAYER_LEAVE=null // playerevent EVENT_PLAYER_END_CINEMATIC=null // playerunitevent EVENT_PLAYER_UNIT_ISSUED_ORDER=null // unitevent EVENT_UNIT_DAMAGED=null // playerevent EVENT_PLAYER_ARROW_LEFT_DOWN=null // playerevent EVENT_PLAYER_ARROW_LEFT_UP=null // playerevent EVENT_PLAYER_ARROW_RIGHT_DOWN=null // playerevent EVENT_PLAYER_ARROW_RIGHT_UP=null // playerevent EVENT_PLAYER_ARROW_DOWN_DOWN=null // playerevent EVENT_PLAYER_ARROW_DOWN_UP=null // playerevent EVENT_PLAYER_ARROW_UP_DOWN=null // playerevent EVENT_PLAYER_ARROW_UP_UP=null // playerevent EVENT_PLAYER_MOUSE_DOWN=null // playerevent EVENT_PLAYER_MOUSE_UP=null // playerevent EVENT_PLAYER_MOUSE_MOVE=null // playerunitevent EVENT_PLAYER_UNIT_SPELL_EFFECT=null // originframetype ORIGIN_FRAME_GAME_UI=null // integer bj_MAX_PLAYERS=0 // integer bj_MAX_PLAYER_SLOTS=0 // rect bj_mapInitialPlayableArea=null player Basics_DUMMY_PLAYER=null integer array BitSet_pows playerevent ClosureEvents_EVENT_PLAYER_CHAT_FILTER=null trigger ClosureEvents_unitTrig=null trigger ClosureEvents_leaveTrig=null trigger ClosureEvents_keyTrig=null integer array ClosureEvents_eventidToIndex integer ClosureEvents_eventTypeCounter=0 integer EventListener_castMap=0 integer array EventListener_castMapCasters integer array EventListener_generalListenersFirsts integer array EventListener_unitListenersFirsts boolean EventListener_useMouseEvents=false integer array ClosureForGroups_tempCallbacks integer ClosureForGroups_iterCount=0 integer ClosureTimers_x=0 string array Colors_hexs integer Colors_decs=0 real DummyRecycler_ANGLE_DEGREE=0. integer array DummyRecycler_angleQueues hashtable ErrorHandling_HT=null framehandle Framehandle_GAME_UI=null real GameTimer_currentTime=0. hashtable HashList_ht=null hashtable HashList_occurences=null unit InstantDummyCaster_caster=null boolean MagicFunctions_compiletime=false rect MapBounds_playableMapRect=null rect MapBounds_boundRect=null region MapBounds_boundRegion=null real MapBounds_playableMin_x=0. real MapBounds_playableMin_y=0. real MapBounds_boundMin_x=0. real MapBounds_boundMin_y=0. real MapBounds_boundMax_x=0. real MapBounds_boundMax_y=0. trigger OnUnitEnterLeave_eventTrigger=null group OnUnitEnterLeave_preplacedUnits=null unit array OnUnitEnterLeave_tempUnits integer OnUnitEnterLeave_tempUnitsCount=0 player array Player_players player Player_localPlayer=null group Preloader_dumg=null unit Preloader_dum=null trigger array RegisterEvents_t integer RegisterEvents_onCastMap=0 hashtable Table_ht=null timer array TimerUtils_freeTimers integer TimerUtils_freeTimersCount=0 integer TimerUtils_timerData=0 integer TypeCasting_typecastdata=0 trigger UnitIndexer_onIndexTrigger=null trigger UnitIndexer_onDeindexTrigger=null unit array UnitIndexer_tempUnits integer UnitIndexer_tempUnitsCount=0 integer nullclosurebug_MAX_PLAYERS=0 integer nullclosurebug_commands=0 hashtable hashtable_compiletime=null hashtable hashtable_compiletime_160=null hashtable hashtable_compiletime_161=null hashtable hashtable_compiletime_162=null integer array CallbackSingle_nextFree integer CallbackSingle_firstFree=0 integer CallbackSingle_maxIndex=0 integer array CallbackSingle_typeId integer EventListener_firstFree=0 integer array EventListener_typeId integer array OnCastListener_nextFree integer OnCastListener_firstFree=0 integer OnCastListener_maxIndex=0 integer array OnCastListener_typeId integer array ForGroupCallback_nextFree integer ForGroupCallback_firstFree=0 integer ForGroupCallback_maxIndex=0 integer array ForGroupCallback_typeId integer Callback_firstFree=0 integer array Callback_typeId integer array DummyCaster_nextFree integer DummyCaster_firstFree=0 integer DummyCaster_maxIndex=0 integer array DummyCaster_typeId integer array HashList_typeId integer array Table_nextFree integer Table_firstFree=0 integer Table_maxIndex=0 integer array Table_typeId integer Comparator_firstFree=0 integer Comparator_maxIndex=0 integer array LLEntry_nextFree integer LLEntry_firstFree=0 integer LLEntry_maxIndex=0 integer array LLEntry_typeId integer array LLItrClosure_nextFree integer LLItrClosure_firstFree=0 integer LLItrClosure_maxIndex=0 integer array LLItrClosure_typeId integer array LinkedList_nextFree integer LinkedList_firstFree=0 integer LinkedList_maxIndex=0 integer array LinkedList_typeId integer array MapClosure_typeId integer IdGenerator_firstFree=0 integer IdGenerator_maxIndex=0 integer array OrderStringFactory_nextFree integer OrderStringFactory_firstFree=0 integer OrderStringFactory_maxIndex=0 integer array UnitIndex_nextFree integer UnitIndex_firstFree=0 integer UnitIndex_maxIndex=0 integer array UnitIndex_typeId integer array CommandHandler_nextFree integer CommandHandler_firstFree=0 integer CommandHandler_maxIndex=0 integer array CommandHandler_typeId integer array EventListener_eventId integer array EventListener_uid integer array EventListener_next integer array EventListener_prev integer array OnCastListener_next integer array OnCastListener_prev integer array OnCastListener_abilId unit array OnCastListener_eventUnit integer array cb timerdialog array dia timer array CallbackSingle_t integer array DummyCaster_castCount real array DummyCaster_delay player array DummyCaster_owner real array DummyCaster_origin_x real array DummyCaster_origin_y integer array this unit array dummy integer array id unit array u integer array HashList_size integer array HashMap_size integer array IterableMap_keys integer array result integer array LLEntry_elem integer array LLEntry_prev integer array LLEntry_next integer array LinkedList_dummy integer array LinkedList_size integer array output integer array itr unit array UnitIndex__unit unit array a unit array a_152 code ref_function_init_Abilities=null code ref_function_init_AbilityIds=null code ref_function_init_Real=null code ref_function_init_Integer=null code ref_function_init_BitSet=null code ref_function_init_String=null code ref_function_init_TargetsAllowed=null code ref_function_init_Angle=null code ref_function_init_Vectors=null code ref_function_init_Destructable=null code ref_function_init_Player=null code ref_function_init_Maths=null code ref_function_init_Printing=null code ref_function_init_MagicFunctions=null code ref_function_init_Basics=null code ref_function_init_GameTimer=null code ref_function_init_ErrorHandling=null code ref_function_init_Matrices=null code ref_function_init_Quaternion=null code ref_function_init_Table=null code ref_function_init_Playercolor=null code ref_function_init_Colors=null code ref_function_init_Framehandle=null code ref_function_init_Group=null code ref_function_init_Lightning=null code ref_function_init_WeatherEffects=null code ref_function_init_TypeCasting=null code ref_function_init_HashList=null code ref_function_init_EventHelper=null code ref_function_init_AbilityObjEditing=null code ref_function_init_AttachmentPoints=null code ref_function_init_BuffIds=null code ref_function_init_Buildings=null code ref_function_init_ClosureForGroups=null code ref_function_init_LinkedList=null code ref_function_init_ObjectIds=null code ref_function_init_TimerUtils=null code ref_function_init_ClosureTimers=null code ref_function_init_UnitIds=null code ref_function_init_MapBounds=null code ref_function_init_Preloader=null code ref_function_init_ObjectIdGenerator=null code ref_function_init_Icons=null code ref_function_init_ChannelAbilityPreset=null code ref_function_init_RegisterEvents=null code ref_function_init_Orders=null code ref_function_init_OnUnitEnterLeave=null code ref_function_init_UnitIndexer=null code ref_function_init_ClosureEvents=null code ref_function_init_Doodads=null code ref_function_init_DummyRecycler=null code ref_function_init_InstantDummyCaster=null code ref_function_init_ItemIds=null code ref_function_init_Objects=null code ref_function_init_Sounds=null code ref_function_init_Soundsets=null code ref_function_init_StringUtils=null code ref_function_init_Textures=null code ref_function_init_UI=null code ref_function_init_Units=null code ref_function_init_nullclosurebug=null code ref_function_code__onUnitIndex_ClosureEvents=null code ref_function_code__onUnitDeindex_ClosureEvents=null code ref_function_EventListener_generalEventCallback=null code ref_function_code__Filter_ClosureForGroups=null code ref_function_code__startPeriodic_GameTimer=null code ref_function_code__registerPlayerUnitEvent_RegisterEvents=null code ref_function_code__onEnter_UnitIndexer=null code ref_function_code__onLeave_UnitIndexer=null code ref_function_code__addAction_nullclosurebug=null code ref_function_code__addAction_nullTimer_ClosureEvents=null code ref_function_code__addAction_nullTimer_ClosureEvents_173=null code ref_function_code__addAction_nullTimer_ClosureEvents_174=null code ref_function_code__registerPlayerUnitEvent_nullTimer_ClosureEvents=null code ref_function_code__start_CallbackSingle_ClosureTimers=null code ref_function_code__Filter_registerEnterRegion_nullTimer_OnUnitEnterLeave=null code ref_function_code__registerPlayerUnitEvent_nullTimer_OnUnitEnterLeave=null code ref_function_code__ForGroup_nullTimer_OnUnitEnterLeave=null endglobals function Loglevel_getTag takes integer this_1 returns string if this_1 == 0 then return "|cffADADADtrace|r" elseif this_1 == 1 then return "|cff2685DCdebug|r" elseif this_1 == 2 then return "|cffFFCC00info|r" elseif this_1 == 3 then return "|cffF47E3Ewarning|r" else return "|cffFB2700error|r" endif endfunction function compileError takes string msg returns nothing endfunction function error takes string msg returns nothing local integer hash local player showTo if MagicFunctions_compiletime then call compileError("ERROR: " + msg) else set hash = StringHash(msg) if HaveSavedInteger(ErrorHandling_HT, -1, hash) then if LoadInteger(ErrorHandling_HT, -1, hash) + 60 < GameTimer_currentTime then set msg = msg + "" set showTo = Player_localPlayer if 2 <= 4 then call DisplayTimedTextToPlayer(showTo, 0., 0., 45., Loglevel_getTag(4) + " - " + msg) endif call SaveInteger(ErrorHandling_HT, -1, hash, R2I(GameTimer_currentTime)) call SaveBoolean(ErrorHandling_HT, -1, hash, false) elseif HaveSavedBoolean(ErrorHandling_HT, -1, hash) then if not LoadBoolean(ErrorHandling_HT, -1, hash) then set showTo = Player_localPlayer if 2 <= 4 then call DisplayTimedTextToPlayer(showTo, 0., 0., 45., Loglevel_getTag(4) + " - " + "|cffFF3A29Excessive repeating errors are being omitted") endif call SaveBoolean(ErrorHandling_HT, -1, hash, true) endif else set showTo = Player_localPlayer if 2 <= 4 then call DisplayTimedTextToPlayer(showTo, 0., 0., 45., Loglevel_getTag(4) + " - " + "|cffFF3A29Excessive repeating errors are being omitted") endif call SaveBoolean(ErrorHandling_HT, -1, hash, true) endif else call SaveInteger(ErrorHandling_HT, -1, hash, R2I(GameTimer_currentTime)) set msg = "Message: " + msg + "" set showTo = Player_localPlayer if 2 <= 4 then call DisplayTimedTextToPlayer(showTo, 0., 0., 45., Loglevel_getTag(4) + " - " + msg) endif endif call I2S(1 / 0) endif endfunction function initCompiletimeState_0 takes nothing returns nothing set hashtable_compiletime_162 = InitHashtable() set hashtable_compiletime_161 = InitHashtable() set hashtable_compiletime_160 = InitHashtable() set hashtable_compiletime = InitHashtable() call SaveInteger(hashtable_compiletime_160, 1, -242600650, 0) call SaveInteger(hashtable_compiletime_160, 1, 1132341824, 1) call SaveInteger(hashtable_compiletime_160, 1, -647782241, 2) call SaveInteger(hashtable_compiletime_160, 1, -854572045, 3) call SaveInteger(hashtable_compiletime_160, 1, -680649701, 4) call SaveInteger(hashtable_compiletime_160, 1, -943650483, 5) call SaveInteger(hashtable_compiletime_160, 1, -671760605, 6) call SaveInteger(hashtable_compiletime_160, 1, 349230650, 7) call SaveInteger(hashtable_compiletime_160, 1, -1894922563, 8) call SaveInteger(hashtable_compiletime_160, 1, -1474492777, 9) call SaveInteger(hashtable_compiletime_160, 1, -1587459251, 10) call SaveInteger(hashtable_compiletime_160, 1, -1676716706, 11) call SaveInteger(hashtable_compiletime_160, 1, -1559655710, 12) call SaveInteger(hashtable_compiletime_160, 1, -1663695754, 13) call SaveInteger(hashtable_compiletime_160, 1, 597637742, 14) call SaveInteger(hashtable_compiletime_160, 1, 789744696, 15) call SaveStr(hashtable_compiletime_160, 2, 0, "") call SaveStr(hashtable_compiletime_160, 2, 1804483594, "air") call SaveStr(hashtable_compiletime_160, 2, -1221441622, "debris") call SaveStr(hashtable_compiletime_160, 2, -681966791, "ground") call SaveStr(hashtable_compiletime_160, 2, -1912775212, "invulnerable") call SaveStr(hashtable_compiletime_160, 2, 392811314, "item") call SaveStr(hashtable_compiletime_160, 2, 124309475, "structure") call SaveStr(hashtable_compiletime_160, 2, -543400682, "vulnerable") call SaveStr(hashtable_compiletime_160, 2, -85648186, "ward") call SaveStr(hashtable_compiletime_160, 2, -612826229, "Avul") call SaveStr(hashtable_compiletime_160, 2, 1282521876, "Aloc") call SaveStr(hashtable_compiletime_160, 2, -263269125, "AM03") call SaveStr(hashtable_compiletime_160, 2, 512215473, "Agho") endfunction function registerPlayerUnitEvent takes playerunitevent p, code filter, code condition, code action returns nothing local integer hid = GetHandleId(p) local integer k local filterfunc cond_result local trigger temp local player temp_1 if RegisterEvents_t[hid] == null then set RegisterEvents_t[hid] = CreateTrigger() set k = bj_MAX_PLAYER_SLOTS - 1 loop exitwhen k < 0 set temp = RegisterEvents_t[hid] set temp_1 = Player_players[k] if filter != null then set cond_result = Filter(filter) else set cond_result = null endif call TriggerRegisterPlayerUnitEvent(temp, temp_1, p, cond_result) set k = k - 1 endloop endif if condition != null then call TriggerAddCondition(RegisterEvents_t[hid], Filter(condition)) endif if action != null then call TriggerAddAction(RegisterEvents_t[hid], action) endif endfunction function registerEventId takes eventid evnt returns integer local integer eventId = GetHandleId(evnt) local trigger receiver local integer eventId_1 local boolean andLeft set ClosureEvents_eventTypeCounter = ClosureEvents_eventTypeCounter + 1 set ClosureEvents_eventidToIndex[eventId] = ClosureEvents_eventTypeCounter set eventId_1 = GetHandleId(evnt) if (eventId_1 >= 18 and eventId_1 <= 51) or (eventId_1 >= 269 and eventId_1 <= 277) or eventId_1 == 315 or eventId_1 == 308 then call registerPlayerUnitEvent(ConvertPlayerUnitEvent(eventId), null, ref_function_EventListener_generalEventCallback, null) else if evnt != EVENT_UNIT_DAMAGED and evnt != EVENT_PLAYER_LEAVE and evnt != ClosureEvents_EVENT_PLAYER_CHAT_FILTER then set eventId_1 = GetHandleId(evnt) set andLeft = eventId_1 < 261 or eventId_1 > 268 and eventId_1 != 17 else set andLeft = false endif if andLeft then set eventId_1 = GetHandleId(evnt) set andLeft = eventId_1 < 305 or eventId_1 > 307 else set andLeft = false endif if andLeft then call error("registering handleid: " + I2S(eventId) + " non-playerunitevent. Except EVENT_UNIT_DAMAGED and EVENT_PLAYER_LEAVE these are not supported right now.") endif endif set eventId = GetHandleId(evnt) if eventId >= 305 and eventId <= 307 and ( not EventListener_useMouseEvents) then set EventListener_useMouseEvents = true set eventId = 0 set eventId_1 = bj_MAX_PLAYERS - 1 loop exitwhen eventId > eventId_1 set receiver = ClosureEvents_keyTrig call TriggerRegisterPlayerEvent(receiver, Player_players[eventId], EVENT_PLAYER_MOUSE_UP) call TriggerRegisterPlayerEvent(receiver, Player_players[eventId], EVENT_PLAYER_MOUSE_DOWN) call TriggerRegisterPlayerEvent(receiver, Player_players[eventId], EVENT_PLAYER_MOUSE_MOVE) set eventId = eventId + 1 endloop endif return ClosureEvents_eventTypeCounter endfunction function EventListener_generalEventCallback takes nothing returns nothing local unit trigUnit = GetTriggerUnit() local eventid this_1 = GetTriggerEventId() local integer id_1 = ClosureEvents_eventidToIndex[GetHandleId(this_1)] local integer listener local boolean andLeft if id_1 == 0 then set id_1 = registerEventId(this_1) endif if trigUnit != null then set andLeft = GetUnitUserData(trigUnit) > 0 else set andLeft = false endif if andLeft then if EventListener_unitListenersFirsts[GetUnitUserData(trigUnit)] != 0 then set listener = EventListener_unitListenersFirsts[GetUnitUserData(trigUnit)] loop exitwhen listener == 0 set listener = EventListener_next[listener] endloop endif endif if EventListener_generalListenersFirsts[id_1] != 0 then set id_1 = EventListener_generalListenersFirsts[id_1] loop exitwhen id_1 == 0 set id_1 = EventListener_next[id_1] endloop endif endfunction function new_LLEntry takes integer elem, integer prev, integer next returns integer local integer this_1 if LLEntry_firstFree == 0 then if LLEntry_maxIndex < 32768 then set LLEntry_maxIndex = LLEntry_maxIndex + 1 set this_1 = LLEntry_maxIndex set LLEntry_typeId[this_1] = 721 else call error("Out of memory: Could not create LLEntry.") set this_1 = 0 endif else set LLEntry_firstFree = LLEntry_firstFree - 1 set this_1 = LLEntry_nextFree[LLEntry_firstFree] set LLEntry_typeId[this_1] = 721 endif set LLEntry_elem[this_1] = elem set LLEntry_prev[this_1] = prev set LLEntry_next[this_1] = next return this_1 endfunction function dispatch_LinkedList_LinkedList_LinkedList_add_1 takes integer this_1, integer elems_0 returns nothing local integer entry if LinkedList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling LinkedList.add") else call error("Called LinkedList.add on invalid object.") endif endif set entry = new_LLEntry(elems_0, LLEntry_prev[LinkedList_dummy[this_1]], LinkedList_dummy[this_1]) set LLEntry_next[LLEntry_prev[LinkedList_dummy[this_1]]] = entry set LLEntry_prev[LinkedList_dummy[this_1]] = entry set LinkedList_size[this_1] = LinkedList_size[this_1] + 1 endfunction function dispatch_ForGroupCallback_ClosureForGroups_ForGroupCallback_callback takes integer this_1, unit u_1 returns nothing if ForGroupCallback_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling ForGroupCallback.callback") else call error("Called ForGroupCallback.callback on invalid object.") endif endif if ForGroupCallback_typeId[this_1] <= 667 then call dispatch_LinkedList_LinkedList_LinkedList_add_1(result[this_1], GetHandleId(u_1)) else call RemoveUnit(u_1) endif endfunction function code__Filter_ClosureForGroups takes nothing returns nothing local unit filter = GetFilterUnit() if ClosureForGroups_iterCount < 2147483647 then call dispatch_ForGroupCallback_ClosureForGroups_ForGroupCallback_callback(ClosureForGroups_tempCallbacks[-1], filter) endif set ClosureForGroups_iterCount = ClosureForGroups_iterCount + 1 endfunction function prepareUnit takes unit u_1 returns nothing call UnitAddAbility(u_1, 1095577649) call UnitMakeAbilityPermanent(u_1, true, 1095577649) set OnUnitEnterLeave_tempUnits[OnUnitEnterLeave_tempUnitsCount] = u_1 set OnUnitEnterLeave_tempUnitsCount = OnUnitEnterLeave_tempUnitsCount + 1 call TriggerEvaluate(OnUnitEnterLeave_eventTrigger) set OnUnitEnterLeave_tempUnitsCount = OnUnitEnterLeave_tempUnitsCount - 1 endfunction function code__Filter_registerEnterRegion_nullTimer_OnUnitEnterLeave takes nothing returns nothing call prepareUnit(GetFilterUnit()) endfunction function code__ForGroup_nullTimer_OnUnitEnterLeave takes nothing returns nothing call prepareUnit(GetEnumUnit()) endfunction function code__addAction_nullTimer_ClosureEvents takes nothing returns nothing call EventListener_generalEventCallback() endfunction function code__addAction_nullTimer_ClosureEvents_138 takes nothing returns nothing call EventListener_generalEventCallback() endfunction function code__addAction_nullTimer_ClosureEvents_139 takes nothing returns nothing call EventListener_generalEventCallback() endfunction function dispatch_Table_Table_Table_loadString takes integer this_1, integer parentKey returns string if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling Table.loadString") else call error("Called Table.loadString on invalid object.") endif endif return LoadStr(Table_ht, this_1, parentKey) endfunction function dispatch_Table_Table_Table_hasString takes integer this_1, integer parentKey returns boolean if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling Table.hasString") else call error("Called Table.hasString on invalid object.") endif endif return HaveSavedString(Table_ht, this_1, parentKey) endfunction function dispatch_Table_Table_Table_saveString takes integer this_1, integer parentKey, string value returns nothing if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling Table.saveString") else call error("Called Table.saveString on invalid object.") endif endif call SaveStr(Table_ht, this_1, parentKey, value) endfunction function stringToIndex takes string s returns integer local integer hash = StringHash(s) loop if dispatch_Table_Table_Table_hasString(TypeCasting_typecastdata, hash) then exitwhen dispatch_Table_Table_Table_loadString(TypeCasting_typecastdata, hash) == s else call dispatch_Table_Table_Table_saveString(TypeCasting_typecastdata, hash, s) exitwhen true endif set hash = hash + 1 endloop return hash endfunction function run_wrapper takes integer this_1, integer t returns integer local string result_1 = "" local integer byteno local integer charValue set this_1 = t set byteno = 0 loop exitwhen byteno > 3 set charValue = ModuloInteger(this_1, 256) set this_1 = this_1 / 256 set result_1 = SubString(".................................!.#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[.]^_`abcdefghijklmnopqrstuvwxyz{|}~.................................................................................................................................", charValue, charValue + 1) + result_1 set byteno = byteno + 1 endloop return stringToIndex(result_1) endfunction function dispatch_LLItrClosure_LinkedList_LLItrClosure_run takes integer this_1, integer t returns nothing local integer temp if LLItrClosure_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling LLItrClosure.run") else call error("Called LLItrClosure.run on invalid object.") endif endif if LLItrClosure_typeId[this_1] <= 724 then set temp = output[this_1] set this_1 = itr[this_1] if MapClosure_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling MapClosure.run") else call error("Called MapClosure.run on invalid object.") endif endif call dispatch_LinkedList_LinkedList_LinkedList_add_1(temp, run_wrapper(this_1, t)) else call DisplayTimedTextToPlayer(Player_localPlayer, 0., 0., 45., dispatch_Table_Table_Table_loadString(TypeCasting_typecastdata, t)) endif endfunction function dispatch_LLItrClosure_destroyLLItrClosure takes integer this_1 returns nothing if LLItrClosure_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling LLItrClosure.LLItrClosure") else call error("Called LLItrClosure.LLItrClosure on invalid object.") endif endif if LLItrClosure_typeId[this_1] == 0 then call error("Double free: object of type LLItrClosure") else set LLItrClosure_nextFree[LLItrClosure_firstFree] = this_1 set LLItrClosure_firstFree = LLItrClosure_firstFree + 1 set LLItrClosure_typeId[this_1] = 0 endif endfunction function dispatch_LinkedList_LinkedList_LinkedList_forEach takes integer this_1, integer itr_1 returns integer local integer this_2 if LinkedList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling LinkedList.forEach") else call error("Called LinkedList.forEach on invalid object.") endif endif set this_2 = this_1 set this_1 = LLEntry_next[LinkedList_dummy[this_1]] loop exitwhen this_1 == LinkedList_dummy[this_2] call dispatch_LLItrClosure_LinkedList_LLItrClosure_run(itr_1, LLEntry_elem[this_1]) set this_1 = LLEntry_next[this_1] endloop call dispatch_LLItrClosure_destroyLLItrClosure(itr_1) return this_2 endfunction function run_registerCommandAll_nullclosurebug takes integer this_1, player triggerPlayer, integer args returns nothing call DisplayTimedTextToPlayer(Player_localPlayer, 0., 0., 45., "player " + I2S(GetPlayerId(triggerPlayer))) if LLItrClosure_firstFree == 0 then if LLItrClosure_maxIndex < 32768 then set LLItrClosure_maxIndex = LLItrClosure_maxIndex + 1 set this_1 = LLItrClosure_maxIndex set LLItrClosure_typeId[this_1] = 725 else call error("Out of memory: Could not create LLItrClosure_forEach_registerCommandAll_nullclosurebug.") set this_1 = 0 endif else set LLItrClosure_firstFree = LLItrClosure_firstFree - 1 set this_1 = LLItrClosure_nextFree[LLItrClosure_firstFree] set LLItrClosure_typeId[this_1] = 725 endif call dispatch_LinkedList_LinkedList_LinkedList_forEach(args, this_1) endfunction function InstantDummyCaster_finish takes integer id_1 returns nothing call SetUnitOwner(InstantDummyCaster_caster, Basics_DUMMY_PLAYER, false) call UnitRemoveAbility(InstantDummyCaster_caster, id_1) call SetUnitPosition(InstantDummyCaster_caster, MapBounds_boundMax_x, MapBounds_boundMax_y) endfunction function unit_setXYZ takes unit this_1, real pos_x, real pos_y, real pos_z returns nothing call SetUnitX(this_1, pos_x) call SetUnitY(this_1, pos_y) call SetUnitFlyHeight(this_1, pos_z, 0.) endfunction function InstantDummyCaster_prepare takes player owner, integer id_1, integer lvl, real pos_x, real pos_y, real pos_z returns nothing local unit receiver = InstantDummyCaster_caster call UnitAddAbility(receiver, id_1) call SetUnitState(receiver, UNIT_STATE_MANA, 1000000.) if pos_x > MapBounds_boundMin_x and pos_x < MapBounds_boundMax_x and pos_y > MapBounds_boundMin_y and pos_y < MapBounds_boundMax_y then call unit_setXYZ(InstantDummyCaster_caster, pos_x, pos_y, pos_z) endif if lvl > 1 then call SetUnitAbilityLevel(InstantDummyCaster_caster, id_1, lvl) endif if owner != null then call SetUnitOwner(InstantDummyCaster_caster, owner, false) endif endfunction function InstantDummyCaster_castImmediate takes player owner, integer abilityId, integer lvl, integer orderId, real pos_x, real pos_y, real pos_z returns boolean local boolean success call InstantDummyCaster_prepare(owner, abilityId, lvl, pos_x, pos_y, pos_z) set success = IssueImmediateOrderById(InstantDummyCaster_caster, orderId) call InstantDummyCaster_finish(abilityId) return success endfunction function run_registerCommandAll_nullclosurebug_272 takes integer this_1, player triggerPlayer, integer arguments returns nothing local unit this_2 local real temp local real tuple_temp set triggerPlayer = GetOwningPlayer(a[this_1]) set this_2 = a[this_1] set temp = GetUnitX(this_2) set tuple_temp = GetUnitY(this_2) call InstantDummyCaster_castImmediate(triggerPlayer, 1095267427, 1, OrderId("thunderclap"), temp, tuple_temp, 0.) endfunction function run_registerCommandAll_nullclosurebug_273 takes integer this_1, player triggerPlayer, integer arguments returns nothing local group receiver local unit iterUnit call DisplayTimedTextToPlayer(Player_localPlayer, 0., 0., 45., GetUnitName(a_152[this_1])) set receiver = CreateGroup() call GroupEnumUnitsSelected(receiver, triggerPlayer, null) loop exitwhen FirstOfGroup(receiver) == null set iterUnit = FirstOfGroup(receiver) call GroupRemoveUnit(receiver, iterUnit) call SetUnitOwner(iterUnit, Player_players[1], true) endloop endfunction function dispatch_CommandHandler_nullclosurebug_CommandHandler_run takes integer this_1, player triggerPlayer, integer arguments returns nothing if CommandHandler_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling CommandHandler.run") else call error("Called CommandHandler.run on invalid object.") endif endif if CommandHandler_typeId[this_1] <= 654 then if CommandHandler_typeId[this_1] <= 653 then call run_registerCommandAll_nullclosurebug(this_1, triggerPlayer, arguments) else call run_registerCommandAll_nullclosurebug_272(this_1, triggerPlayer, arguments) endif else call run_registerCommandAll_nullclosurebug_273(this_1, triggerPlayer, arguments) endif endfunction function dispatch_LinkedList_LinkedList_LinkedList_getEntry takes integer this_1, integer index returns integer local integer entry if LinkedList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling LinkedList.getEntry") else call error("Called LinkedList.getEntry on invalid object.") endif endif set entry = LinkedList_dummy[this_1] set this_1 = 0 loop exitwhen this_1 > index set entry = LLEntry_next[entry] set this_1 = this_1 + 1 endloop return entry endfunction function dispatch_Table_Table_Table_hasInt takes integer this_1, integer parentKey returns boolean if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling Table.hasInt") else call error("Called Table.hasInt on invalid object.") endif endif return HaveSavedInteger(Table_ht, this_1, parentKey) endfunction function dispatch_Table_Table_Table_loadInt takes integer this_1, integer parentKey returns integer if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling Table.loadInt") else call error("Called Table.loadInt on invalid object.") endif endif return LoadInteger(Table_ht, this_1, parentKey) endfunction function new_LinkedList takes nothing returns integer local integer this_1 if LinkedList_firstFree == 0 then if LinkedList_maxIndex < 32768 then set LinkedList_maxIndex = LinkedList_maxIndex + 1 set this_1 = LinkedList_maxIndex set LinkedList_typeId[this_1] = 726 else call error("Out of memory: Could not create LinkedList.") set this_1 = 0 endif else set LinkedList_firstFree = LinkedList_firstFree - 1 set this_1 = LinkedList_nextFree[LinkedList_firstFree] set LinkedList_typeId[this_1] = 726 endif set LinkedList_dummy[this_1] = new_LLEntry(0, 0, 0) set LinkedList_size[this_1] = 0 set LLEntry_next[LinkedList_dummy[this_1]] = LinkedList_dummy[this_1] set LLEntry_prev[LinkedList_dummy[this_1]] = LinkedList_dummy[this_1] return this_1 endfunction function string_indexOf takes string this_1, string s returns integer local integer i = 0 local integer temp = StringLength(this_1) - StringLength(s) loop exitwhen i > temp if SubString(this_1, i, i + StringLength(s)) == s then return i endif set i = i + 1 endloop return -1 endfunction function string_split takes string this_1, string splitBy returns integer local integer list = new_LinkedList() local integer offset = StringLength(splitBy) local string str = this_1 local integer splitIndex loop set splitIndex = string_indexOf(str, splitBy) if splitIndex == -1 then call dispatch_LinkedList_LinkedList_LinkedList_add_1(list, stringToIndex(str)) exitwhen true endif set this_1 = SubString(str, 0, splitIndex) set str = SubString(str, splitIndex + offset, StringLength(str)) call dispatch_LinkedList_LinkedList_LinkedList_add_1(list, stringToIndex(this_1)) endloop return list endfunction function code__addAction_nullclosurebug takes nothing returns nothing local player triggerPlayer = GetTriggerPlayer() local integer tokens = nullclosurebug_commands local integer HashMap_HashMap_get_result = GetPlayerId(triggerPlayer) local string this_1 local integer key if Table_typeId[tokens] == 0 then if tokens == 0 then call error("Nullpointer exception when calling HashMap.get") else call error("Called HashMap.get on invalid object.") endif endif set HashMap_HashMap_get_result = dispatch_Table_Table_Table_loadInt(tokens, HashMap_HashMap_get_result) set this_1 = GetEventPlayerChatString() set tokens = string_split(SubString(this_1, 1, StringLength(this_1)), " ") if LinkedList_typeId[tokens] == 0 then if tokens == 0 then call error("Nullpointer exception when calling LinkedList.get") else call error("Called LinkedList.get on invalid object.") endif endif set key = LLEntry_elem[dispatch_LinkedList_LinkedList_LinkedList_getEntry(tokens, 0)] set this_1 = dispatch_Table_Table_Table_loadString(TypeCasting_typecastdata, key) set key = stringToIndex(this_1) if Table_typeId[HashMap_HashMap_get_result] == 0 then if HashMap_HashMap_get_result == 0 then call error("Nullpointer exception when calling HashMap.has") else call error("Called HashMap.has on invalid object.") endif endif if dispatch_Table_Table_Table_hasInt(HashMap_HashMap_get_result, key) then set key = stringToIndex(this_1) if Table_typeId[HashMap_HashMap_get_result] == 0 then if HashMap_HashMap_get_result == 0 then call error("Nullpointer exception when calling HashMap.get") else call error("Called HashMap.get on invalid object.") endif endif call dispatch_CommandHandler_nullclosurebug_CommandHandler_run(dispatch_Table_Table_Table_loadInt(HashMap_HashMap_get_result, key), triggerPlayer, tokens) endif endfunction function construct_UnitIndex takes integer this_1, unit whichUnit returns nothing set UnitIndex__unit[this_1] = whichUnit call SetUnitUserData(UnitIndex__unit[this_1], this_1) set UnitIndexer_tempUnits[UnitIndexer_tempUnitsCount] = whichUnit set UnitIndexer_tempUnitsCount = UnitIndexer_tempUnitsCount + 1 call TriggerEvaluate(UnitIndexer_onIndexTrigger) set UnitIndexer_tempUnitsCount = UnitIndexer_tempUnitsCount - 1 endfunction function new_UnitIndex takes unit whichUnit returns integer local integer this_1 if UnitIndex_firstFree == 0 then if UnitIndex_maxIndex < 32768 then set UnitIndex_maxIndex = UnitIndex_maxIndex + 1 set this_1 = UnitIndex_maxIndex set UnitIndex_typeId[this_1] = 774 else call error("Out of memory: Could not create UnitIndex.") set this_1 = 0 endif else set UnitIndex_firstFree = UnitIndex_firstFree - 1 set this_1 = UnitIndex_nextFree[UnitIndex_firstFree] set UnitIndex_typeId[this_1] = 774 endif call construct_UnitIndex(this_1, whichUnit) return this_1 endfunction function code__onEnter_UnitIndexer takes nothing returns nothing local unit this_1 = OnUnitEnterLeave_tempUnits[OnUnitEnterLeave_tempUnitsCount - 1] if GetUnitUserData(this_1) == 0 then call new_UnitIndex(this_1) endif endfunction function UnitIndex_onDestroy takes integer this_1 returns nothing set UnitIndexer_tempUnits[UnitIndexer_tempUnitsCount] = UnitIndex__unit[this_1] set UnitIndexer_tempUnitsCount = UnitIndexer_tempUnitsCount + 1 call TriggerEvaluate(UnitIndexer_onDeindexTrigger) set UnitIndexer_tempUnitsCount = UnitIndexer_tempUnitsCount - 1 call SetUnitUserData(UnitIndex__unit[this_1], 0) endfunction function dispatch_UnitIndex_destroyUnitIndex takes integer this_1 returns nothing if UnitIndex_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling UnitIndex.UnitIndex") else call error("Called UnitIndex.UnitIndex on invalid object.") endif endif call UnitIndex_onDestroy(this_1) if UnitIndex_typeId[this_1] == 0 then call error("Double free: object of type UnitIndex") else set UnitIndex_nextFree[UnitIndex_firstFree] = this_1 set UnitIndex_firstFree = UnitIndex_firstFree + 1 set UnitIndex_typeId[this_1] = 0 endif endfunction function unit_deindex takes unit this_1 returns boolean local integer instance if GetUnitUserData(this_1) == 0 then return false else set instance = GetUnitUserData(this_1) if instance == 0 then set instance = new_UnitIndex(this_1) endif call dispatch_UnitIndex_destroyUnitIndex(instance) return true endif endfunction function code__onLeave_UnitIndexer takes nothing returns nothing call unit_deindex(OnUnitEnterLeave_tempUnits[OnUnitEnterLeave_tempUnitsCount - 1]) endfunction function dispatch_Table_Table_Table_saveInt takes integer this_1, integer parentKey, integer value returns nothing if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling Table.saveInt") else call error("Called Table.saveInt on invalid object.") endif endif call SaveInteger(Table_ht, this_1, parentKey, value) endfunction function HashMap_put takes integer this_1, integer key, integer value returns nothing if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashMap.has") else call error("Called HashMap.has on invalid object.") endif endif if not dispatch_Table_Table_Table_hasInt(this_1, key) then set HashMap_size[this_1] = HashMap_size[this_1] + 1 endif call dispatch_Table_Table_Table_saveInt(this_1, key, value) endfunction function dispatch_HashList_HashList_HashList_count takes integer this_1, integer elem returns integer if HashList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashList.count") else call error("Called HashList.count on invalid object.") endif endif return LoadInteger(HashList_occurences, this_1, elem) endfunction function dispatch_HashList_HashList_HashList_incrOccurences takes integer this_1, integer elem returns nothing if HashList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashList.incrOccurences") else call error("Called HashList.incrOccurences on invalid object.") endif endif call SaveInteger(HashList_occurences, this_1, elem, dispatch_HashList_HashList_HashList_count(this_1, elem) + 1) endfunction function dispatch_HashList_HashList_HashList_add_1 takes integer this_1, integer elems_0 returns nothing if HashList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashList.add") else call error("Called HashList.add on invalid object.") endif endif call SaveInteger(HashList_ht, this_1, HashList_size[this_1], elems_0) call dispatch_HashList_HashList_HashList_incrOccurences(this_1, elems_0) set HashList_size[this_1] = HashList_size[this_1] + 1 endfunction function dispatch_IterableMap_HashMap_IterableMap_hasKey takes integer this_1, integer key returns boolean if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling IterableMap.hasKey") else call error("Called IterableMap.hasKey on invalid object.") endif endif set this_1 = IterableMap_keys[this_1] if HashList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashList.has") else call error("Called HashList.has on invalid object.") endif endif return dispatch_HashList_HashList_HashList_count(this_1, key) > 0 endfunction function dispatch_HashMap_HashMap_HashMap_put takes integer this_1, integer key, integer value returns nothing if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashMap.put") else call error("Called HashMap.put on invalid object.") endif endif if Table_typeId[this_1] <= 765 then call HashMap_put(this_1, key, value) else call HashMap_put(this_1, key, value) if not dispatch_IterableMap_HashMap_IterableMap_hasKey(this_1, key) then call dispatch_HashList_HashList_HashList_add_1(IterableMap_keys[this_1], key) endif endif endfunction function HashMap_remove takes integer this_1, integer key returns nothing local integer parentKey if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashMap.has") else call error("Called HashMap.has on invalid object.") endif endif if dispatch_Table_Table_Table_hasInt(this_1, key) then set HashMap_size[this_1] = HashMap_size[this_1] - 1 endif set parentKey = key if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling Table.removeInt") else call error("Called Table.removeInt on invalid object.") endif endif call RemoveSavedInteger(Table_ht, this_1, parentKey) endfunction function dispatch_HashList_HashList_HashList_decrOccurences takes integer this_1, integer elem returns nothing if HashList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashList.decrOccurences") else call error("Called HashList.decrOccurences on invalid object.") endif endif call SaveInteger(HashList_occurences, this_1, elem, dispatch_HashList_HashList_HashList_count(this_1, elem) - 1) endfunction function HashList_removeAt takes integer this_1, integer index returns integer local integer tmp local integer temp call dispatch_HashList_HashList_HashList_decrOccurences(this_1, LoadInteger(HashList_ht, this_1, index)) set tmp = LoadInteger(HashList_ht, this_1, index) set temp = HashList_size[this_1] loop exitwhen index > temp call SaveInteger(HashList_ht, this_1, index, LoadInteger(HashList_ht, this_1, index + 1)) set index = index + 1 endloop set HashList_size[this_1] = HashList_size[this_1] - 1 return tmp endfunction function HashList_remove takes integer this_1, integer t returns boolean local boolean result_1 = false local integer i = 0 local integer temp = HashList_size[this_1] - 1 loop exitwhen i > temp if t == LoadInteger(HashList_ht, this_1, i) then set result_1 = true if HashList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashList.removeAt") else call error("Called HashList.removeAt on invalid object.") endif endif call HashList_removeAt(this_1, i) exitwhen true endif set i = i + 1 endloop return result_1 endfunction function IterableMap_remove takes integer this_1, integer key returns nothing call HashMap_remove(this_1, key) if dispatch_IterableMap_HashMap_IterableMap_hasKey(this_1, key) then set this_1 = IterableMap_keys[this_1] if HashList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashList.remove") else call error("Called HashList.remove on invalid object.") endif endif call HashList_remove(this_1, key) endif endfunction function dispatch_HashMap_HashMap_HashMap_remove takes integer this_1, integer key returns nothing if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashMap.remove") else call error("Called HashMap.remove on invalid object.") endif endif if Table_typeId[this_1] <= 765 then call HashMap_remove(this_1, key) else call IterableMap_remove(this_1, key) endif endfunction function OnCastListener_onDestroy takes integer this_1 returns nothing local integer this_2 local integer key if OnCastListener_eventUnit[this_1] != null then set this_2 = GetUnitUserData(OnCastListener_eventUnit[this_1]) if EventListener_castMapCasters[this_2] == this_1 then if OnCastListener_next[this_1] != 0 then set EventListener_castMapCasters[this_2] = OnCastListener_next[this_1] else set EventListener_castMapCasters[this_2] = 0 endif elseif OnCastListener_prev[this_1] != 0 then set OnCastListener_next[OnCastListener_prev[this_1]] = OnCastListener_next[this_1] endif else set this_2 = EventListener_castMap set key = OnCastListener_abilId[this_1] if Table_typeId[this_2] == 0 then if this_2 == 0 then call error("Nullpointer exception when calling HashMap.get") else call error("Called HashMap.get on invalid object.") endif endif set key = dispatch_Table_Table_Table_loadInt(this_2, key) if key == this_1 then if OnCastListener_next[this_1] != 0 then call dispatch_HashMap_HashMap_HashMap_put(EventListener_castMap, OnCastListener_abilId[this_1], OnCastListener_next[this_1]) else call dispatch_HashMap_HashMap_HashMap_remove(EventListener_castMap, OnCastListener_abilId[this_1]) endif elseif OnCastListener_prev[this_1] != 0 then set OnCastListener_next[OnCastListener_prev[this_1]] = OnCastListener_next[this_1] endif endif set OnCastListener_prev[OnCastListener_next[this_1]] = OnCastListener_prev[this_1] set OnCastListener_next[this_1] = 0 set OnCastListener_prev[this_1] = 0 endfunction function dispatch_OnCastListener_destroyOnCastListener takes integer this_1 returns nothing if OnCastListener_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling OnCastListener.OnCastListener") else call error("Called OnCastListener.OnCastListener on invalid object.") endif endif call OnCastListener_onDestroy(this_1) if OnCastListener_typeId[this_1] == 0 then call error("Double free: object of type OnCastListener") else set OnCastListener_nextFree[OnCastListener_firstFree] = this_1 set OnCastListener_firstFree = OnCastListener_firstFree + 1 set OnCastListener_typeId[this_1] = 0 endif endfunction function destroyEventListener takes integer this_1 returns nothing if EventListener_uid[this_1] < 0 then if EventListener_generalListenersFirsts[EventListener_eventId[this_1]] == this_1 then set EventListener_generalListenersFirsts[EventListener_eventId[this_1]] = EventListener_next[this_1] elseif EventListener_prev[this_1] != 0 then set EventListener_next[EventListener_prev[this_1]] = EventListener_next[this_1] endif elseif EventListener_unitListenersFirsts[EventListener_uid[this_1]] == this_1 then set EventListener_unitListenersFirsts[EventListener_uid[this_1]] = EventListener_next[this_1] elseif EventListener_prev[this_1] != 0 then set EventListener_next[EventListener_prev[this_1]] = EventListener_next[this_1] endif if EventListener_next[this_1] != 0 then set EventListener_prev[EventListener_next[this_1]] = EventListener_prev[this_1] endif set EventListener_next[this_1] = 0 set EventListener_prev[this_1] = 0 if EventListener_typeId[this_1] == 0 then call error("Double free: object of type EventListener") else set EventListener_firstFree = EventListener_firstFree + 1 set EventListener_typeId[this_1] = 0 endif endfunction function unregisterEvents takes integer id_1 returns nothing local integer listener local string msg local player showTo if id_1 > 0 then if EventListener_unitListenersFirsts[id_1] != 0 then set msg = "unregister unit has listeners. startid: " + I2S(id_1) set showTo = Player_localPlayer if 2 <= 0 then call DisplayTimedTextToPlayer(showTo, 0., 0., 45., Loglevel_getTag(0) + " - " + msg) endif set listener = EventListener_unitListenersFirsts[id_1] set EventListener_unitListenersFirsts[id_1] = 0 loop exitwhen listener == 0 set id_1 = listener set listener = EventListener_next[listener] if EventListener_typeId[id_1] == 0 then if id_1 == 0 then call error("Nullpointer exception when calling EventListener.EventListener") else call error("Called EventListener.EventListener on invalid object.") endif endif call destroyEventListener(id_1) endloop endif endif endfunction function unregisterEventsForUnit takes unit u_1 returns nothing local integer index = GetUnitUserData(u_1) local integer listener call unregisterEvents(index) if EventListener_castMapCasters[index] != 0 then set listener = EventListener_castMapCasters[index] set EventListener_castMapCasters[index] = 0 loop exitwhen listener == 0 set index = listener set listener = OnCastListener_next[listener] call dispatch_OnCastListener_destroyOnCastListener(index) endloop endif endfunction function code__onUnitDeindex_ClosureEvents takes nothing returns nothing call unregisterEventsForUnit(UnitIndexer_tempUnits[UnitIndexer_tempUnitsCount - 1]) endfunction function code__onUnitIndex_ClosureEvents takes nothing returns nothing call TriggerRegisterUnitEvent(ClosureEvents_unitTrig, UnitIndexer_tempUnits[UnitIndexer_tempUnitsCount - 1], EVENT_UNIT_DAMAGED) endfunction function triggerFromIndex takes integer index returns trigger local integer this_1 = TypeCasting_typecastdata local fogstate value = ConvertFogState(index) if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling Table.saveFogState") else call error("Called Table.saveFogState on invalid object.") endif endif call SaveFogStateHandle(Table_ht, this_1, 0, value) set index = TypeCasting_typecastdata if Table_typeId[index] == 0 then if index == 0 then call error("Nullpointer exception when calling Table.loadTrigger") else call error("Called Table.loadTrigger on invalid object.") endif endif return LoadTriggerHandle(Table_ht, index, 0) endfunction function code__registerPlayerUnitEvent_RegisterEvents takes nothing returns boolean local integer this_1 = RegisterEvents_onCastMap local integer key = GetSpellAbilityId() if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashMap.get") else call error("Called HashMap.get on invalid object.") endif endif return TriggerEvaluate(triggerFromIndex(dispatch_Table_Table_Table_loadInt(this_1, key))) endfunction function CallbackSingle_start takes integer this_1, timer whichTimer, real time returns nothing call dispatch_Table_Table_Table_saveInt(TimerUtils_timerData, GetHandleId(whichTimer), this_1) call TimerStart(whichTimer, time, false, ref_function_code__start_CallbackSingle_ClosureTimers) set CallbackSingle_t[this_1] = whichTimer endfunction function getTimer takes nothing returns timer local timer this_1 if TimerUtils_freeTimersCount > 0 then set TimerUtils_freeTimersCount = TimerUtils_freeTimersCount - 1 set this_1 = TimerUtils_freeTimers[TimerUtils_freeTimersCount] call dispatch_Table_Table_Table_saveInt(TimerUtils_timerData, GetHandleId(this_1), 0) return TimerUtils_freeTimers[TimerUtils_freeTimersCount] else set this_1 = CreateTimer() call dispatch_Table_Table_Table_saveInt(TimerUtils_timerData, GetHandleId(this_1), 0) return this_1 endif endfunction function doAfter takes real timeToWait, integer cb_1 returns integer local timer this_1 = getTimer() if CallbackSingle_typeId[cb_1] == 0 then if cb_1 == 0 then call error("Nullpointer exception when calling CallbackSingle.start") else call error("Called CallbackSingle.start on invalid object.") endif endif call CallbackSingle_start(cb_1, this_1, timeToWait) return cb_1 endfunction function DummyCaster_finish takes integer this_1, unit dummy_1, integer id_1 returns nothing local real temp local integer this_2 set DummyCaster_castCount[this_1] = DummyCaster_castCount[this_1] + 1 set temp = DummyCaster_delay[this_1] if CallbackSingle_firstFree == 0 then if CallbackSingle_maxIndex < 32768 then set CallbackSingle_maxIndex = CallbackSingle_maxIndex + 1 set this_2 = CallbackSingle_maxIndex set CallbackSingle_typeId[this_2] = 647 else call error("Out of memory: Could not create CallbackSingle_doAfter_DummyCaster_DummyCaster.") set this_2 = 0 endif else set CallbackSingle_firstFree = CallbackSingle_firstFree - 1 set this_2 = CallbackSingle_nextFree[CallbackSingle_firstFree] set CallbackSingle_typeId[this_2] = 647 endif set this[this_2] = this_1 set dummy[this_2] = dummy_1 set id[this_2] = id_1 call doAfter(temp, this_2) endfunction function createDummy takes real pos_x, real pos_y, real facing_radians returns unit local unit u_1 = CreateUnit(Basics_DUMMY_PLAYER, 2016423985, pos_x, pos_y, facing_radians * 57.295779513) call UnitAddAbility(u_1, 1097691750) call UnitRemoveAbility(u_1, 1097691750) call UnitAddAbility(u_1, 1095577650) call UnitRemoveAbility(u_1, 1095577650) call SetUnitX(u_1, pos_x) call SetUnitY(u_1, pos_y) call SetUnitFacing(u_1, facing_radians * 57.295779513) return u_1 endfunction function dispatch_LLEntry_destroyLLEntry takes integer this_1 returns nothing if LLEntry_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling LLEntry.LLEntry") else call error("Called LLEntry.LLEntry on invalid object.") endif endif if LLEntry_typeId[this_1] == 0 then call error("Double free: object of type LLEntry") else set LLEntry_nextFree[LLEntry_firstFree] = this_1 set LLEntry_firstFree = LLEntry_firstFree + 1 set LLEntry_typeId[this_1] = 0 endif endfunction function dispatch_LinkedList_LinkedList_LinkedList_removeEntry takes integer this_1, integer entry returns nothing if LinkedList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling LinkedList.removeEntry") else call error("Called LinkedList.removeEntry on invalid object.") endif endif set LLEntry_next[LLEntry_prev[entry]] = LLEntry_next[entry] set LLEntry_prev[LLEntry_next[entry]] = LLEntry_prev[entry] call dispatch_LLEntry_destroyLLEntry(entry) set LinkedList_size[this_1] = LinkedList_size[this_1] - 1 endfunction function dispatch_LinkedList_LinkedList_LinkedList_dequeue takes integer this_1 returns integer local integer top local integer result_1 if LinkedList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling LinkedList.dequeue") else call error("Called LinkedList.dequeue on invalid object.") endif endif set top = LLEntry_next[LinkedList_dummy[this_1]] set result_1 = 0 if top != LinkedList_dummy[this_1] then set result_1 = LLEntry_elem[top] call dispatch_LinkedList_LinkedList_LinkedList_removeEntry(this_1, top) endif return result_1 endfunction function unitFromIndex takes integer index returns unit local integer this_1 = TypeCasting_typecastdata local fogstate value = ConvertFogState(index) if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling Table.saveFogState") else call error("Called Table.saveFogState on invalid object.") endif endif call SaveFogStateHandle(Table_ht, this_1, 0, value) set index = TypeCasting_typecastdata if Table_typeId[index] == 0 then if index == 0 then call error("Nullpointer exception when calling Table.loadUnit") else call error("Called Table.loadUnit on invalid object.") endif endif return LoadUnitHandle(Table_ht, index, 0) endfunction function DummyRecycler_get takes real pos_x, real pos_y, real a_radians returns unit local real this_1 = ModuloReal(a_radians * 57.295779513, 360.) / DummyRecycler_ANGLE_DEGREE local integer angleIndex local unit receiver local integer this_2 if this_1 > 0. then set this_2 = R2I(this_1 + .5) else set this_2 = R2I(this_1 - .5) endif set angleIndex = ModuloInteger(this_2, 8) set this_2 = DummyRecycler_angleQueues[angleIndex] if LinkedList_typeId[this_2] == 0 then if this_2 == 0 then call error("Nullpointer exception when calling LinkedList.size") else call error("Called LinkedList.size on invalid object.") endif endif if LinkedList_size[this_2] > 0 then set receiver = unitFromIndex(dispatch_LinkedList_LinkedList_LinkedList_dequeue(DummyRecycler_angleQueues[angleIndex])) call SetUnitX(receiver, pos_x) call SetUnitY(receiver, pos_y) call PauseUnit(receiver, false) return receiver else return createDummy(pos_x, pos_y, a_radians) endif endfunction function DummyCaster_prepare takes integer this_1, integer id_1, integer lvl returns unit local unit dummy_1 = DummyRecycler_get(DummyCaster_origin_x[this_1], DummyCaster_origin_y[this_1], 0.) local real tuple_temp_1 = DummyCaster_origin_x[this_1] local real tuple_temp = DummyCaster_origin_y[this_1] if tuple_temp_1 > MapBounds_boundMin_x and tuple_temp_1 < MapBounds_boundMax_x and tuple_temp > MapBounds_boundMin_y and tuple_temp < MapBounds_boundMax_y then set tuple_temp = DummyCaster_origin_x[this_1] set tuple_temp_1 = DummyCaster_origin_y[this_1] call SetUnitX(dummy_1, tuple_temp) call SetUnitY(dummy_1, tuple_temp_1) endif call UnitAddAbility(dummy_1, id_1) call SetUnitState(dummy_1, UNIT_STATE_MANA, 1000000.) if lvl > 1 then call SetUnitAbilityLevel(dummy_1, id_1, lvl) endif call SetUnitOwner(dummy_1, DummyCaster_owner[this_1], false) return dummy_1 endfunction function DummyCaster_castPoint takes integer this_1, integer abilityId, integer lvl, integer orderId, real targetPos_x, real targetPos_y returns unit local unit dummy_1 local boolean success local unit DummyCaster_DummyCaster_prepare_result local real temp local real tuple_temp if DummyCaster_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling DummyCaster.prepare") else call error("Called DummyCaster.prepare on invalid object.") endif endif set DummyCaster_DummyCaster_prepare_result = DummyCaster_prepare(this_1, abilityId, lvl) set dummy_1 = DummyCaster_DummyCaster_prepare_result set temp = GetUnitX(DummyCaster_DummyCaster_prepare_result) set tuple_temp = GetUnitY(DummyCaster_DummyCaster_prepare_result) set tuple_temp = Atan2(targetPos_y - tuple_temp, targetPos_x - temp) call SetUnitFacing(DummyCaster_DummyCaster_prepare_result, tuple_temp * 57.295779513) set success = IssuePointOrderById(DummyCaster_DummyCaster_prepare_result, orderId, targetPos_x, targetPos_y) if DummyCaster_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling DummyCaster.finish") else call error("Called DummyCaster.finish on invalid object.") endif endif call DummyCaster_finish(this_1, DummyCaster_DummyCaster_prepare_result, abilityId) if not success then set dummy_1 = null endif return dummy_1 endfunction function new_DummyCaster takes nothing returns integer local integer this_1 if DummyCaster_firstFree == 0 then if DummyCaster_maxIndex < 32768 then set DummyCaster_maxIndex = DummyCaster_maxIndex + 1 set this_1 = DummyCaster_maxIndex set DummyCaster_typeId[this_1] = 660 else call error("Out of memory: Could not create DummyCaster.") set this_1 = 0 endif else set DummyCaster_firstFree = DummyCaster_firstFree - 1 set this_1 = DummyCaster_nextFree[DummyCaster_firstFree] set DummyCaster_typeId[this_1] = 660 endif set DummyCaster_castCount[this_1] = 0 set DummyCaster_delay[this_1] = 5.0 set DummyCaster_owner[this_1] = Basics_DUMMY_PLAYER set DummyCaster_origin_x[this_1] = 0. set DummyCaster_origin_y[this_1] = 0. return this_1 endfunction function fireEx_onPointCast_nullclosurebug takes integer this_1, unit caster, real target_x, real target_y returns nothing local player owner local real tuple_temp local real tuple_temp_1 call DisplayTimedTextToPlayer(Player_localPlayer, 0., 0., 45., "Spell has been casted") set this_1 = new_DummyCaster() if DummyCaster_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling DummyCaster.delay") else call error("Called DummyCaster.delay on invalid object.") endif endif set DummyCaster_delay[this_1] = 3. set owner = GetOwningPlayer(caster) if DummyCaster_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling DummyCaster.owner") else call error("Called DummyCaster.owner on invalid object.") endif endif set DummyCaster_owner[this_1] = owner set tuple_temp_1 = GetUnitX(caster) set tuple_temp = GetUnitY(caster) set tuple_temp_1 = tuple_temp_1 + 100. set tuple_temp = tuple_temp + 0. if DummyCaster_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling DummyCaster.origin") else call error("Called DummyCaster.origin on invalid object.") endif endif set DummyCaster_origin_x[this_1] = tuple_temp_1 set DummyCaster_origin_y[this_1] = tuple_temp if DummyCaster_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling DummyCaster.castPoint") else call error("Called DummyCaster.castPoint on invalid object.") endif endif call DummyCaster_castPoint(this_1, 1095262842, 1, 852089, target_x, target_y) endfunction function OnPointCast_fire takes integer this_1, unit caster returns nothing local real tuple_temp = GetSpellTargetX() local real tuple_temp_1 = GetSpellTargetY() if OnCastListener_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling OnPointCast.fireEx") else call error("Called OnPointCast.fireEx on invalid object.") endif endif call fireEx_onPointCast_nullclosurebug(this_1, caster, tuple_temp, tuple_temp_1) endfunction function dispatch_OnCastListener_ClosureEvents_OnCastListener_fire takes integer this_1, unit caster returns nothing if OnCastListener_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling OnCastListener.fire") else call error("Called OnCastListener.fire on invalid object.") endif endif if OnCastListener_typeId[this_1] <= 737 then if OnCastListener_typeId[this_1] <= 735 then else call OnPointCast_fire(this_1, caster) endif endif endfunction function EventListener_onSpellEffect takes nothing returns nothing local unit trigUnit = GetTriggerUnit() local integer abilId = GetSpellAbilityId() local integer listener = GetUnitUserData(trigUnit) local integer nextListener if EventListener_castMapCasters[listener] != 0 then set listener = EventListener_castMapCasters[listener] loop exitwhen listener == 0 set nextListener = OnCastListener_next[listener] if OnCastListener_abilId[listener] == -1 or OnCastListener_abilId[listener] == abilId then call dispatch_OnCastListener_ClosureEvents_OnCastListener_fire(listener, GetSpellAbilityUnit()) endif set listener = nextListener endloop endif set listener = EventListener_castMap if Table_typeId[listener] == 0 then if listener == 0 then call error("Nullpointer exception when calling HashMap.has") else call error("Called HashMap.has on invalid object.") endif endif if dispatch_Table_Table_Table_hasInt(listener, abilId) then set listener = EventListener_castMap if Table_typeId[listener] == 0 then if listener == 0 then call error("Nullpointer exception when calling HashMap.get") else call error("Called HashMap.get on invalid object.") endif endif set listener = dispatch_Table_Table_Table_loadInt(listener, abilId) loop exitwhen listener == 0 set abilId = OnCastListener_next[listener] if OnCastListener_eventUnit[listener] == null or OnCastListener_eventUnit[listener] == trigUnit then call dispatch_OnCastListener_ClosureEvents_OnCastListener_fire(listener, GetSpellAbilityUnit()) endif set listener = abilId endloop endif endfunction function code__registerPlayerUnitEvent_nullTimer_ClosureEvents takes nothing returns nothing call EventListener_onSpellEffect() endfunction function code__registerPlayerUnitEvent_nullTimer_OnUnitEnterLeave takes nothing returns nothing local unit leavingUnit = GetTriggerUnit() if GetUnitAbilityLevel(leavingUnit, 1095577649) == 0 and GetIssuedOrderId() == 852056 then set OnUnitEnterLeave_tempUnits[OnUnitEnterLeave_tempUnitsCount] = leavingUnit set OnUnitEnterLeave_tempUnitsCount = OnUnitEnterLeave_tempUnitsCount + 1 call TriggerExecute(OnUnitEnterLeave_eventTrigger) set OnUnitEnterLeave_tempUnitsCount = OnUnitEnterLeave_tempUnitsCount - 1 endif endfunction function code__startPeriodic_GameTimer takes nothing returns nothing set GameTimer_currentTime = GameTimer_currentTime + 0.030 endfunction function DummyRecycler_recycle takes unit u_1 returns nothing local integer smallestQueue = 0 local integer i = 1 local integer temp = 7 local integer LinkedList_LinkedList_size_result local integer this_1 local integer elem local real tuple_temp local real tuple_temp_1 loop exitwhen i > temp set LinkedList_LinkedList_size_result = DummyRecycler_angleQueues[smallestQueue] if LinkedList_typeId[LinkedList_LinkedList_size_result] == 0 then if LinkedList_LinkedList_size_result == 0 then call error("Nullpointer exception when calling LinkedList.size") else call error("Called LinkedList.size on invalid object.") endif endif set LinkedList_LinkedList_size_result = LinkedList_size[LinkedList_LinkedList_size_result] set this_1 = DummyRecycler_angleQueues[i] if LinkedList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling LinkedList.size") else call error("Called LinkedList.size on invalid object.") endif endif if LinkedList_LinkedList_size_result > LinkedList_size[this_1] then set smallestQueue = i endif set i = i + 1 endloop set temp = DummyRecycler_angleQueues[smallestQueue] if LinkedList_typeId[temp] == 0 then if temp == 0 then call error("Nullpointer exception when calling LinkedList.size") else call error("Called LinkedList.size on invalid object.") endif endif if LinkedList_size[temp] >= 6 then call RemoveUnit(u_1) else set temp = DummyRecycler_angleQueues[smallestQueue] set elem = GetHandleId(u_1) if LinkedList_typeId[temp] == 0 then if temp == 0 then call error("Nullpointer exception when calling LinkedList.enqueue") else call error("Called LinkedList.enqueue on invalid object.") endif endif call dispatch_LinkedList_LinkedList_LinkedList_add_1(temp, elem) set tuple_temp_1 = MapBounds_boundMax_x set tuple_temp = MapBounds_boundMax_y set tuple_temp_1 = tuple_temp_1 - 16. set tuple_temp = tuple_temp - 16. call SetUnitX(u_1, tuple_temp_1) call SetUnitY(u_1, tuple_temp) call PauseUnit(u_1, true) set tuple_temp = smallestQueue * DummyRecycler_ANGLE_DEGREE * 0.017453293 call SetUnitFacing(u_1, tuple_temp * 57.295779513) call SetUnitScale(u_1, 1., 1., 1.) call SetUnitVertexColor(u_1, 255, 255, 255, 255) call SetUnitOwner(u_1, Basics_DUMMY_PLAYER, true) endif endfunction function dispatch_Callback_destroyCallback takes integer this_1 returns nothing if Callback_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling Callback.Callback") else call error("Called Callback.Callback on invalid object.") endif endif if Callback_typeId[this_1] == 0 then call error("Double free: object of type Callback") else set Callback_firstFree = Callback_firstFree + 1 set Callback_typeId[this_1] = 0 endif endfunction function call_doAfter_ClosureTimers takes integer this_1 returns nothing call dispatch_Callback_destroyCallback(cb[this_1]) call DestroyTimerDialog(dia[this_1]) endfunction function call_nullTimer_ClosureEvents takes integer this_1 returns nothing local integer temp local trigger receiver call TriggerAddAction(ClosureEvents_unitTrig, ref_function_code__addAction_nullTimer_ClosureEvents) call TriggerAddAction(ClosureEvents_leaveTrig, ref_function_code__addAction_nullTimer_ClosureEvents_173) call TriggerAddAction(ClosureEvents_keyTrig, ref_function_code__addAction_nullTimer_ClosureEvents_174) set this_1 = 0 set temp = bj_MAX_PLAYERS - 1 loop exitwhen this_1 > temp call TriggerRegisterPlayerEvent(ClosureEvents_leaveTrig, Player_players[this_1], EVENT_PLAYER_LEAVE) set receiver = ClosureEvents_keyTrig call TriggerRegisterPlayerEvent(receiver, Player_players[this_1], EVENT_PLAYER_ARROW_DOWN_DOWN) call TriggerRegisterPlayerEvent(receiver, Player_players[this_1], EVENT_PLAYER_ARROW_DOWN_UP) call TriggerRegisterPlayerEvent(receiver, Player_players[this_1], EVENT_PLAYER_ARROW_UP_DOWN) call TriggerRegisterPlayerEvent(receiver, Player_players[this_1], EVENT_PLAYER_ARROW_UP_UP) call TriggerRegisterPlayerEvent(receiver, Player_players[this_1], EVENT_PLAYER_ARROW_LEFT_DOWN) call TriggerRegisterPlayerEvent(receiver, Player_players[this_1], EVENT_PLAYER_ARROW_LEFT_UP) call TriggerRegisterPlayerEvent(receiver, Player_players[this_1], EVENT_PLAYER_ARROW_RIGHT_DOWN) call TriggerRegisterPlayerEvent(receiver, Player_players[this_1], EVENT_PLAYER_ARROW_RIGHT_UP) call TriggerRegisterPlayerEvent(receiver, Player_players[this_1], EVENT_PLAYER_END_CINEMATIC) call TriggerRegisterPlayerChatEvent(receiver, Player_players[this_1], "", false) set this_1 = this_1 + 1 endloop call registerPlayerUnitEvent(EVENT_PLAYER_UNIT_SPELL_EFFECT, null, ref_function_code__registerPlayerUnitEvent_nullTimer_ClosureEvents, null) endfunction function call_nullTimer_OnUnitEnterLeave takes integer this_1 returns nothing local group receiver call TriggerRegisterEnterRegion(CreateTrigger(), MapBounds_boundRegion, Filter(ref_function_code__Filter_registerEnterRegion_nullTimer_OnUnitEnterLeave)) call registerPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_ORDER, null, ref_function_code__registerPlayerUnitEvent_nullTimer_OnUnitEnterLeave, null) set receiver = OnUnitEnterLeave_preplacedUnits call GroupEnumUnitsInRect(receiver, MapBounds_boundRect, null) call ForGroup(OnUnitEnterLeave_preplacedUnits, ref_function_code__ForGroup_nullTimer_OnUnitEnterLeave) set receiver = OnUnitEnterLeave_preplacedUnits call GroupClear(receiver) call DestroyGroup(receiver) endfunction function dispatch_DummyCaster_DummyCaster_DummyCaster_recycleDummy takes integer this_1, unit dummy_1, integer id_1 returns nothing if DummyCaster_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling DummyCaster.recycleDummy") else call error("Called DummyCaster.recycleDummy on invalid object.") endif endif call UnitRemoveAbility(dummy_1, id_1) call DummyRecycler_recycle(dummy_1) endfunction function dispatch_DummyCaster_destroyDummyCaster takes integer this_1 returns nothing if DummyCaster_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling DummyCaster.DummyCaster") else call error("Called DummyCaster.DummyCaster on invalid object.") endif endif if DummyCaster_typeId[this_1] == 0 then call error("Double free: object of type DummyCaster") else set DummyCaster_nextFree[DummyCaster_firstFree] = this_1 set DummyCaster_firstFree = DummyCaster_firstFree + 1 set DummyCaster_typeId[this_1] = 0 endif endfunction function dispatch_ForGroupCallback_destroyForGroupCallback takes integer this_1 returns nothing if ForGroupCallback_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling ForGroupCallback.ForGroupCallback") else call error("Called ForGroupCallback.ForGroupCallback on invalid object.") endif endif if ForGroupCallback_typeId[this_1] == 0 then call error("Double free: object of type ForGroupCallback") else set ForGroupCallback_nextFree[ForGroupCallback_firstFree] = this_1 set ForGroupCallback_firstFree = ForGroupCallback_firstFree + 1 set ForGroupCallback_typeId[this_1] = 0 endif endfunction function group_forEachFrom takes group this_1, integer cb_1 returns nothing local unit iterUnit loop exitwhen FirstOfGroup(this_1) == null set iterUnit = FirstOfGroup(this_1) call GroupRemoveUnit(this_1, iterUnit) call dispatch_ForGroupCallback_ClosureForGroups_ForGroupCallback_callback(cb_1, iterUnit) endloop call dispatch_ForGroupCallback_destroyForGroupCallback(cb_1) endfunction function finishPreload takes nothing returns nothing local group temp local integer this_1 call RemoveUnit(Preloader_dum) set temp = Preloader_dumg if ForGroupCallback_firstFree == 0 then if ForGroupCallback_maxIndex < 32768 then set ForGroupCallback_maxIndex = ForGroupCallback_maxIndex + 1 set this_1 = ForGroupCallback_maxIndex set ForGroupCallback_typeId[this_1] = 668 else call error("Out of memory: Could not create ForGroupCallback_forEachFrom_Preloader.") set this_1 = 0 endif else set ForGroupCallback_firstFree = ForGroupCallback_firstFree - 1 set this_1 = ForGroupCallback_nextFree[ForGroupCallback_firstFree] set ForGroupCallback_typeId[this_1] = 668 endif call group_forEachFrom(temp, this_1) call DestroyGroup(Preloader_dumg) set Preloader_dumg = null endfunction function testFail takes string msg returns nothing endfunction function dispatch_CallbackSingle_ClosureTimers_CallbackSingle_call takes integer this_1 returns nothing if CallbackSingle_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling CallbackSingle.call") else call error("Called CallbackSingle.call on invalid object.") endif endif if CallbackSingle_typeId[this_1] <= 647 then if CallbackSingle_typeId[this_1] <= 645 then if CallbackSingle_typeId[this_1] <= 644 then if CallbackSingle_typeId[this_1] <= 643 then call call_doAfter_ClosureTimers(this_1) else set ClosureTimers_x = ClosureTimers_x + 50 endif else set ClosureTimers_x = ClosureTimers_x * 2 endif elseif CallbackSingle_typeId[this_1] <= 646 then set ClosureTimers_x = ClosureTimers_x / 2 set this_1 = ClosureTimers_x if this_1 != 250 then call testFail("Expected <" + I2S(250) + ">, Actual <" + I2S(this_1) + ">") endif else call dispatch_DummyCaster_DummyCaster_DummyCaster_recycleDummy(this[this_1], dummy[this_1], id[this_1]) set DummyCaster_castCount[this[this_1]] = DummyCaster_castCount[this[this_1]] - 1 if DummyCaster_castCount[this[this_1]] == 0 then call dispatch_DummyCaster_destroyDummyCaster(this[this_1]) endif endif elseif CallbackSingle_typeId[this_1] <= 649 then if CallbackSingle_typeId[this_1] <= 648 then call DummyRecycler_recycle(u[this_1]) else call call_nullTimer_ClosureEvents(this_1) endif elseif CallbackSingle_typeId[this_1] <= 650 then call call_nullTimer_OnUnitEnterLeave(this_1) else call finishPreload() endif endfunction function timer_release takes timer this_1 returns nothing if this_1 == null then call error("Trying to release a null timer") return endif if dispatch_Table_Table_Table_loadInt(TimerUtils_timerData, GetHandleId(this_1)) == 679645218 then call error("ReleaseTimer: Double free!") return endif call dispatch_Table_Table_Table_saveInt(TimerUtils_timerData, GetHandleId(this_1), 679645218) call PauseTimer(this_1) set TimerUtils_freeTimers[TimerUtils_freeTimersCount] = this_1 set TimerUtils_freeTimersCount = TimerUtils_freeTimersCount + 1 endfunction function dispatch_CallbackSingle_destroyCallbackSingle takes integer this_1 returns nothing if CallbackSingle_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling CallbackSingle.CallbackSingle") else call error("Called CallbackSingle.CallbackSingle on invalid object.") endif endif call timer_release(CallbackSingle_t[this_1]) if CallbackSingle_typeId[this_1] == 0 then call error("Double free: object of type CallbackSingle") else set CallbackSingle_nextFree[CallbackSingle_firstFree] = this_1 set CallbackSingle_firstFree = CallbackSingle_firstFree + 1 set CallbackSingle_typeId[this_1] = 0 endif endfunction function CallbackSingle_staticCallback takes nothing returns nothing local integer cb_1 = dispatch_Table_Table_Table_loadInt(TimerUtils_timerData, GetHandleId(GetExpiredTimer())) call dispatch_CallbackSingle_ClosureTimers_CallbackSingle_call(cb_1) call dispatch_CallbackSingle_destroyCallbackSingle(cb_1) endfunction function code__start_CallbackSingle_ClosureTimers takes nothing returns nothing call CallbackSingle_staticCallback() endfunction function init_Abilities takes nothing returns boolean return true endfunction function init_AbilityIds takes nothing returns boolean return true endfunction function init_AbilityObjEditing takes nothing returns boolean return true endfunction function init_Angle takes nothing returns boolean return true endfunction function init_AttachmentPoints takes nothing returns boolean return true endfunction function init_Basics takes nothing returns boolean set Basics_DUMMY_PLAYER = Player_players[PLAYER_NEUTRAL_PASSIVE] return true endfunction function initPows takes nothing returns nothing local integer allPows local integer i local integer temp set BitSet_pows[0] = 1 set allPows = 1 set i = 1 set temp = 31 loop exitwhen i > temp set BitSet_pows[i] = BitSet_pows[i - 1] * 2 set allPows = BlzBitOr(allPows, BitSet_pows[i]) set i = i + 1 endloop set i = 0 set temp = 31 loop exitwhen i > temp set i = i + 1 endloop endfunction function init_BitSet takes nothing returns boolean call initPows() return true endfunction function init_BuffIds takes nothing returns boolean return true endfunction function init_Buildings takes nothing returns boolean return true endfunction function new_OrderStringFactory takes nothing returns integer local integer this_1 if OrderStringFactory_firstFree == 0 then if OrderStringFactory_maxIndex < 32768 then set OrderStringFactory_maxIndex = OrderStringFactory_maxIndex + 1 set this_1 = OrderStringFactory_maxIndex else call error("Out of memory: Could not create OrderStringFactory.") set this_1 = 0 endif else set OrderStringFactory_firstFree = OrderStringFactory_firstFree - 1 set this_1 = OrderStringFactory_nextFree[OrderStringFactory_firstFree] endif return this_1 endfunction function init_ChannelAbilityPreset takes nothing returns boolean call new_OrderStringFactory() return true endfunction function new_HashMap takes nothing returns integer local integer this_1 if Table_firstFree == 0 then if Table_maxIndex < 32768 then set Table_maxIndex = Table_maxIndex + 1 set this_1 = Table_maxIndex set Table_typeId[this_1] = 765 else call error("Out of memory: Could not create HashMap.") set this_1 = 0 endif else set Table_firstFree = Table_firstFree - 1 set this_1 = Table_nextFree[Table_firstFree] set Table_typeId[this_1] = 765 endif set HashMap_size[this_1] = 0 return this_1 endfunction function init_ClosureEvents takes nothing returns boolean local integer this_1 local timer this_2 set ClosureEvents_EVENT_PLAYER_CHAT_FILTER = ConvertPlayerEvent(96) set EventListener_castMap = new_HashMap() set ClosureEvents_unitTrig = CreateTrigger() set ClosureEvents_leaveTrig = CreateTrigger() set ClosureEvents_keyTrig = CreateTrigger() call TriggerAddCondition(UnitIndexer_onIndexTrigger, Condition(ref_function_code__onUnitIndex_ClosureEvents)) call TriggerAddCondition(UnitIndexer_onDeindexTrigger, Condition(ref_function_code__onUnitDeindex_ClosureEvents)) if CallbackSingle_firstFree == 0 then if CallbackSingle_maxIndex < 32768 then set CallbackSingle_maxIndex = CallbackSingle_maxIndex + 1 set this_1 = CallbackSingle_maxIndex set CallbackSingle_typeId[this_1] = 649 else call error("Out of memory: Could not create CallbackSingle_nullTimer_ClosureEvents.") set this_1 = 0 endif else set CallbackSingle_firstFree = CallbackSingle_firstFree - 1 set this_1 = CallbackSingle_nextFree[CallbackSingle_firstFree] set CallbackSingle_typeId[this_1] = 649 endif set this_2 = getTimer() if CallbackSingle_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling CallbackSingle.start") else call error("Called CallbackSingle.start on invalid object.") endif endif call CallbackSingle_start(this_1, this_2, 0.) return true endfunction function init_ClosureForGroups takes nothing returns boolean call CreateGroup() call Filter(ref_function_code__Filter_ClosureForGroups) call Rect(0., 0., 0., 0.) return true endfunction function init_ClosureTimers takes nothing returns boolean set ClosureTimers_x = 200 return true endfunction function new_Table takes nothing returns integer local integer this_1 if Table_firstFree == 0 then if Table_maxIndex < 32768 then set Table_maxIndex = Table_maxIndex + 1 set this_1 = Table_maxIndex set Table_typeId[this_1] = 764 else call error("Out of memory: Could not create Table.") set this_1 = 0 endif else set Table_firstFree = Table_firstFree - 1 set this_1 = Table_nextFree[Table_firstFree] set Table_typeId[this_1] = 764 endif return this_1 endfunction function init_Colors takes nothing returns boolean local integer firstpart set Colors_hexs[0] = "0" set Colors_hexs[1] = "1" set Colors_hexs[2] = "2" set Colors_hexs[3] = "3" set Colors_hexs[4] = "4" set Colors_hexs[5] = "5" set Colors_hexs[6] = "6" set Colors_hexs[7] = "7" set Colors_hexs[8] = "8" set Colors_hexs[9] = "9" set Colors_hexs[10] = "A" set Colors_hexs[11] = "B" set Colors_hexs[12] = "C" set Colors_hexs[13] = "D" set Colors_hexs[14] = "E" set Colors_hexs[15] = "F" set Colors_decs = new_Table() set firstpart = 0 loop exitwhen firstpart > 15 call dispatch_Table_Table_Table_saveInt(Colors_decs, StringHash(Colors_hexs[firstpart]), firstpart) set firstpart = firstpart + 1 endloop return true endfunction function init_Destructable takes nothing returns boolean return true endfunction function init_Doodads takes nothing returns boolean return true endfunction function init_DummyRecycler takes nothing returns boolean local integer i local integer temp local real facing_radians local integer j local integer temp_1 local unit dummy_1 local integer this_1 local integer elem set DummyRecycler_ANGLE_DEGREE = 360 * 1. / 8 set i = 0 set temp = 7 loop exitwhen i > temp set DummyRecycler_angleQueues[i] = new_LinkedList() set facing_radians = i * DummyRecycler_ANGLE_DEGREE set j = 0 set temp_1 = 5 loop exitwhen j > temp_1 set dummy_1 = createDummy(MapBounds_boundMax_x - 16., MapBounds_boundMax_y - 16., facing_radians) set this_1 = DummyRecycler_angleQueues[i] set elem = GetHandleId(dummy_1) if LinkedList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling LinkedList.enqueue") else call error("Called LinkedList.enqueue on invalid object.") endif endif call dispatch_LinkedList_LinkedList_LinkedList_add_1(this_1, elem) set j = j + 1 endloop set i = i + 1 endloop return true endfunction function init_ErrorHandling takes nothing returns boolean set ErrorHandling_HT = hashtable_compiletime return true endfunction function init_EventHelper takes nothing returns boolean call new_HashMap() call new_HashMap() call new_Table() return true endfunction function verifyFrameNameLength takes string name returns boolean if StringLength(name) > 560 then call error("Trying to address frame with exceeding maximum frame name length (" + I2S(560) + ") for: " + name) return false endif return true endfunction function init_Framehandle takes nothing returns boolean local framehandle owner set Framehandle_GAME_UI = BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0) set owner = Framehandle_GAME_UI call verifyFrameNameLength("SetMousePositionCage") set owner = BlzCreateFrameByType("FRAME", "SetMousePositionCage", owner, null, 0) call BlzFrameSetSize(owner, 0.0001, 0.0001) return true endfunction function init_GameTimer takes nothing returns boolean call TimerStart(CreateTimer(), 100000., false, null) call TimerStart(CreateTimer(), 0.030, true, ref_function_code__startPeriodic_GameTimer) return true endfunction function init_Group takes nothing returns boolean call CreateGroup() return true endfunction function init_HashList takes nothing returns boolean set HashList_ht = hashtable_compiletime_161 set HashList_occurences = hashtable_compiletime_162 return true endfunction function init_Icons takes nothing returns boolean return true endfunction function init_InstantDummyCaster takes nothing returns boolean local unit receiver = CreateUnit(Basics_DUMMY_PLAYER, 2016423986, MapBounds_boundMax_x, MapBounds_boundMax_y, 0.0) call SetUnitPathing(receiver, false) call UnitAddAbility(receiver, 1097691750) call UnitRemoveAbility(receiver, 1097691750) call UnitAddAbility(receiver, 1095577652) call UnitRemoveAbility(receiver, 1095577652) set InstantDummyCaster_caster = receiver return true endfunction function init_Integer takes nothing returns boolean return true endfunction function init_ItemIds takes nothing returns boolean return true endfunction function init_Lightning takes nothing returns boolean return true endfunction function init_LinkedList takes nothing returns boolean if Comparator_firstFree == 0 then if Comparator_maxIndex < 32768 then set Comparator_maxIndex = Comparator_maxIndex + 1 else call error("Out of memory: Could not create Comparator_LinkedList.") endif else set Comparator_firstFree = Comparator_firstFree - 1 endif if Comparator_firstFree == 0 then if Comparator_maxIndex < 32768 then set Comparator_maxIndex = Comparator_maxIndex + 1 else call error("Out of memory: Could not create Comparator_LinkedList.") endif else set Comparator_firstFree = Comparator_firstFree - 1 endif return true endfunction function init_MagicFunctions takes nothing returns boolean set MagicFunctions_compiletime = false return true endfunction function initMapBounds takes nothing returns nothing local rect cond_result local region receiver local real tuple_temp local real tuple_temp_1 if MagicFunctions_compiletime then set cond_result = Rect(-1024., -1024., 1024., 1024.) else set cond_result = bj_mapInitialPlayableArea endif set MapBounds_playableMapRect = cond_result set receiver = CreateRegion() call RegionAddRect(receiver, MapBounds_playableMapRect) if MagicFunctions_compiletime then set cond_result = Rect(-1536., -1536., 1536., 1536.) else set cond_result = GetWorldBounds() endif set MapBounds_boundRect = cond_result set receiver = CreateRegion() call RegionAddRect(receiver, MapBounds_boundRect) set MapBounds_boundRegion = receiver set tuple_temp = GetRectMinX(MapBounds_playableMapRect) set tuple_temp_1 = GetRectMinY(MapBounds_playableMapRect) set MapBounds_playableMin_x = tuple_temp set MapBounds_playableMin_y = tuple_temp_1 call GetRectMaxX(MapBounds_playableMapRect) call GetRectMaxY(MapBounds_playableMapRect) set tuple_temp = GetRectMinX(MapBounds_boundRect) set tuple_temp_1 = GetRectMinY(MapBounds_boundRect) set MapBounds_boundMin_x = tuple_temp set MapBounds_boundMin_y = tuple_temp_1 set tuple_temp_1 = GetRectMaxX(MapBounds_boundRect) set tuple_temp = GetRectMaxY(MapBounds_boundRect) set MapBounds_boundMax_x = tuple_temp_1 set MapBounds_boundMax_y = tuple_temp endfunction function init_MapBounds takes nothing returns boolean call initMapBounds() return true endfunction function init_Maths takes nothing returns boolean return true endfunction function init_Matrices takes nothing returns boolean return true endfunction function init_ObjectIdGenerator takes nothing returns boolean if IdGenerator_firstFree == 0 then if IdGenerator_maxIndex < 32768 then set IdGenerator_maxIndex = IdGenerator_maxIndex + 1 else call error("Out of memory: Could not create IdGenerator.") endif else set IdGenerator_firstFree = IdGenerator_firstFree - 1 endif if IdGenerator_firstFree == 0 then if IdGenerator_maxIndex < 32768 then set IdGenerator_maxIndex = IdGenerator_maxIndex + 1 else call error("Out of memory: Could not create IdGenerator.") endif else set IdGenerator_firstFree = IdGenerator_firstFree - 1 endif if IdGenerator_firstFree == 0 then if IdGenerator_maxIndex < 32768 then set IdGenerator_maxIndex = IdGenerator_maxIndex + 1 else call error("Out of memory: Could not create IdGenerator.") endif else set IdGenerator_firstFree = IdGenerator_firstFree - 1 endif if IdGenerator_firstFree == 0 then if IdGenerator_maxIndex < 32768 then set IdGenerator_maxIndex = IdGenerator_maxIndex + 1 else call error("Out of memory: Could not create IdGenerator.") endif else set IdGenerator_firstFree = IdGenerator_firstFree - 1 endif if IdGenerator_firstFree == 0 then if IdGenerator_maxIndex < 32768 then set IdGenerator_maxIndex = IdGenerator_maxIndex + 1 else call error("Out of memory: Could not create IdGenerator.") endif else set IdGenerator_firstFree = IdGenerator_firstFree - 1 endif if IdGenerator_firstFree == 0 then if IdGenerator_maxIndex < 32768 then set IdGenerator_maxIndex = IdGenerator_maxIndex + 1 else call error("Out of memory: Could not create IdGenerator.") endif else set IdGenerator_firstFree = IdGenerator_firstFree - 1 endif return true endfunction function init_ObjectIds takes nothing returns boolean return true endfunction function init_Objects takes nothing returns boolean return true endfunction function init_OnUnitEnterLeave takes nothing returns boolean local integer i local integer temp local timer this_1 set OnUnitEnterLeave_eventTrigger = CreateTrigger() set OnUnitEnterLeave_preplacedUnits = CreateGroup() set i = 0 set temp = bj_MAX_PLAYER_SLOTS - 1 loop exitwhen i > temp call SetPlayerAbilityAvailable(Player_players[i], 1095577649, false) set i = i + 1 endloop if CallbackSingle_firstFree == 0 then if CallbackSingle_maxIndex < 32768 then set CallbackSingle_maxIndex = CallbackSingle_maxIndex + 1 set i = CallbackSingle_maxIndex set CallbackSingle_typeId[i] = 650 else call error("Out of memory: Could not create CallbackSingle_nullTimer_OnUnitEnterLeave.") set i = 0 endif else set CallbackSingle_firstFree = CallbackSingle_firstFree - 1 set i = CallbackSingle_nextFree[CallbackSingle_firstFree] set CallbackSingle_typeId[i] = 650 endif set this_1 = getTimer() if CallbackSingle_typeId[i] == 0 then if i == 0 then call error("Nullpointer exception when calling CallbackSingle.start") else call error("Called CallbackSingle.start on invalid object.") endif endif call CallbackSingle_start(i, this_1, 0.) return true endfunction function init_Orders takes nothing returns boolean return true endfunction function init_Player takes nothing returns boolean local integer i local integer temp set Player_localPlayer = GetLocalPlayer() set i = 0 set temp = bj_MAX_PLAYER_SLOTS - 1 loop exitwhen i > temp set Player_players[i] = Player(i) set i = i + 1 endloop return true endfunction function init_Playercolor takes nothing returns boolean return true endfunction function init_Preloader takes nothing returns boolean local integer this_1 local timer this_2 set Preloader_dumg = CreateGroup() set Preloader_dum = CreateUnit(Basics_DUMMY_PLAYER, 1970497636, MapBounds_playableMin_x, MapBounds_playableMin_y, 0.0) call SetUnitInvulnerable(Preloader_dum, true) if Preloader_dum == null then call error("DUMMY_UNITID not added correctly to the map.") endif if CallbackSingle_firstFree == 0 then if CallbackSingle_maxIndex < 32768 then set CallbackSingle_maxIndex = CallbackSingle_maxIndex + 1 set this_1 = CallbackSingle_maxIndex set CallbackSingle_typeId[this_1] = 651 else call error("Out of memory: Could not create CallbackSingle_nullTimer_Preloader.") set this_1 = 0 endif else set CallbackSingle_firstFree = CallbackSingle_firstFree - 1 set this_1 = CallbackSingle_nextFree[CallbackSingle_firstFree] set CallbackSingle_typeId[this_1] = 651 endif set this_2 = getTimer() if CallbackSingle_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling CallbackSingle.start") else call error("Called CallbackSingle.start on invalid object.") endif endif call CallbackSingle_start(this_1, this_2, 0.) return true endfunction function init_Printing takes nothing returns boolean return true endfunction function init_Quaternion takes nothing returns boolean return true endfunction function init_Real takes nothing returns boolean return true endfunction function init_RegisterEvents takes nothing returns boolean set RegisterEvents_onCastMap = new_HashMap() call registerPlayerUnitEvent(EVENT_PLAYER_UNIT_SPELL_EFFECT, null, ref_function_code__registerPlayerUnitEvent_RegisterEvents, null) return true endfunction function init_Sounds takes nothing returns boolean return true endfunction function init_Soundsets takes nothing returns boolean return true endfunction function init_String takes nothing returns boolean return true endfunction function initialize takes nothing returns nothing local integer i = 0 local integer temp = 127 loop exitwhen i > temp set i = i + 1 endloop endfunction function init_StringUtils takes nothing returns boolean call initialize() call stringToIndex("") return true endfunction function init_Table takes nothing returns boolean set Table_ht = hashtable_compiletime_160 return true endfunction function init_TargetsAllowed takes nothing returns boolean return true endfunction function init_Textures takes nothing returns boolean return true endfunction function init_TimerUtils takes nothing returns boolean set TimerUtils_timerData = new_Table() call new_HashMap() return true endfunction function init_TypeCasting takes nothing returns boolean local integer this_1 set TypeCasting_typecastdata = new_Table() set this_1 = TypeCasting_typecastdata if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling Table.saveString") else call error("Called Table.saveString on invalid object.") endif endif call SaveStr(Table_ht, this_1, 0, "") return true endfunction function init_UI takes nothing returns boolean return true endfunction function init_UnitIds takes nothing returns boolean return true endfunction function init_UnitIndexer takes nothing returns boolean set UnitIndexer_onIndexTrigger = CreateTrigger() set UnitIndexer_onDeindexTrigger = CreateTrigger() call TriggerAddCondition(OnUnitEnterLeave_eventTrigger, Filter(ref_function_code__onEnter_UnitIndexer)) call TriggerAddAction(OnUnitEnterLeave_eventTrigger, ref_function_code__onLeave_UnitIndexer) return true endfunction function init_Units takes nothing returns boolean return true endfunction function init_Vectors takes nothing returns boolean call Location(0., 0.) return true endfunction function init_WeatherEffects takes nothing returns boolean return true endfunction function EventListener_addSpellInternal takes unit u_1, integer abilId, integer listener returns integer local integer this_1 local integer HashMap_HashMap_get_result set OnCastListener_abilId[listener] = abilId if u_1 != null then set OnCastListener_eventUnit[listener] = u_1 set abilId = GetUnitUserData(u_1) if EventListener_castMapCasters[abilId] != 0 then set OnCastListener_prev[EventListener_castMapCasters[abilId]] = listener set OnCastListener_next[listener] = EventListener_castMapCasters[abilId] endif set EventListener_castMapCasters[abilId] = listener else set this_1 = EventListener_castMap if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashMap.has") else call error("Called HashMap.has on invalid object.") endif endif if dispatch_Table_Table_Table_hasInt(this_1, abilId) then set this_1 = EventListener_castMap if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashMap.get") else call error("Called HashMap.get on invalid object.") endif endif set OnCastListener_prev[dispatch_Table_Table_Table_loadInt(this_1, abilId)] = listener set this_1 = EventListener_castMap if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashMap.get") else call error("Called HashMap.get on invalid object.") endif endif set HashMap_HashMap_get_result = dispatch_Table_Table_Table_loadInt(this_1, abilId) set OnCastListener_next[listener] = HashMap_HashMap_get_result endif call dispatch_HashMap_HashMap_HashMap_put(EventListener_castMap, abilId, listener) endif return listener endfunction function registerCommand takes player thePlayer, string command, integer handler returns nothing local integer this_1 = nullclosurebug_commands local integer key = GetPlayerId(thePlayer) if Table_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling HashMap.get") else call error("Called HashMap.get on invalid object.") endif endif call dispatch_HashMap_HashMap_HashMap_put(dispatch_Table_Table_Table_loadInt(this_1, key), stringToIndex(command), handler) endfunction function init_nullclosurebug takes nothing returns boolean local trigger t local unit a_1 local unit receiver local string command local integer handler local integer i local integer temp local player p set nullclosurebug_MAX_PLAYERS = PLAYER_NEUTRAL_AGGRESSIVE - 1 set nullclosurebug_commands = new_HashMap() set t = CreateTrigger() set handler = 0 set i = nullclosurebug_MAX_PLAYERS loop exitwhen handler > i set p = Player_players[handler] call dispatch_HashMap_HashMap_HashMap_put(nullclosurebug_commands, GetPlayerId(p), new_HashMap()) call TriggerRegisterPlayerChatEvent(t, Player_players[handler], "-", false) set handler = handler + 1 endloop call TriggerAddAction(t, ref_function_code__addAction_nullclosurebug) if CommandHandler_firstFree == 0 then if CommandHandler_maxIndex < 32768 then set CommandHandler_maxIndex = CommandHandler_maxIndex + 1 set handler = CommandHandler_maxIndex set CommandHandler_typeId[handler] = 653 else call error("Out of memory: Could not create CommandHandler_registerCommandAll_nullclosurebug.") set handler = 0 endif else set CommandHandler_firstFree = CommandHandler_firstFree - 1 set handler = CommandHandler_nextFree[CommandHandler_firstFree] set CommandHandler_typeId[handler] = 653 endif set command = "test-wurst-commands" set i = 0 set temp = nullclosurebug_MAX_PLAYERS loop exitwhen i > temp call registerCommand(Player_players[i], command, handler) set i = i + 1 endloop set p = Player_players[0] call CreateUnit(p, 1752591476, 0., 0., 0.0) set p = Player_players[0] set receiver = CreateUnit(p, 1214344551, 0., 0., 0.0) call UnitAddAbility(receiver, 1095267427) call SetHeroInt(receiver, 500, true) set a_1 = receiver if CommandHandler_firstFree == 0 then if CommandHandler_maxIndex < 32768 then set CommandHandler_maxIndex = CommandHandler_maxIndex + 1 set handler = CommandHandler_maxIndex set CommandHandler_typeId[handler] = 654 else call error("Out of memory: Could not create CommandHandler_registerCommandAll_nullclosurebug.") set handler = 0 endif else set CommandHandler_firstFree = CommandHandler_firstFree - 1 set handler = CommandHandler_nextFree[CommandHandler_firstFree] set CommandHandler_typeId[handler] = 654 endif set a[handler] = receiver set command = "cast" set i = 0 set temp = nullclosurebug_MAX_PLAYERS loop exitwhen i > temp call registerCommand(Player_players[i], command, handler) set i = i + 1 endloop if CommandHandler_firstFree == 0 then if CommandHandler_maxIndex < 32768 then set CommandHandler_maxIndex = CommandHandler_maxIndex + 1 set handler = CommandHandler_maxIndex set CommandHandler_typeId[handler] = 655 else call error("Out of memory: Could not create CommandHandler_registerCommandAll_nullclosurebug.") set handler = 0 endif else set CommandHandler_firstFree = CommandHandler_firstFree - 1 set handler = CommandHandler_nextFree[CommandHandler_firstFree] set CommandHandler_typeId[handler] = 655 endif set a_152[handler] = a_1 set command = "owner" set i = handler set temp = 0 set handler = nullclosurebug_MAX_PLAYERS loop exitwhen temp > handler call registerCommand(Player_players[temp], command, i) set temp = temp + 1 endloop if OnCastListener_firstFree == 0 then if OnCastListener_maxIndex < 32768 then set OnCastListener_maxIndex = OnCastListener_maxIndex + 1 set handler = OnCastListener_maxIndex set OnCastListener_typeId[handler] = 737 else call error("Out of memory: Could not create OnPointCast_onPointCast_nullclosurebug.") set handler = 0 endif else set OnCastListener_firstFree = OnCastListener_firstFree - 1 set handler = OnCastListener_nextFree[OnCastListener_firstFree] set OnCastListener_typeId[handler] = 737 endif set OnCastListener_next[handler] = 0 set OnCastListener_prev[handler] = 0 set OnCastListener_eventUnit[handler] = null call EventListener_addSpellInternal(null, 1095577654, handler) return true endfunction function initGlobals takes nothing returns nothing set ref_function_init_Abilities = function init_Abilities set ref_function_init_AbilityIds = function init_AbilityIds set ref_function_init_Real = function init_Real set ref_function_init_Integer = function init_Integer set ref_function_init_BitSet = function init_BitSet set ref_function_init_String = function init_String set ref_function_init_TargetsAllowed = function init_TargetsAllowed set ref_function_init_Angle = function init_Angle set ref_function_init_Vectors = function init_Vectors set ref_function_init_Destructable = function init_Destructable set ref_function_init_Player = function init_Player set ref_function_init_Maths = function init_Maths set ref_function_init_Printing = function init_Printing set ref_function_init_MagicFunctions = function init_MagicFunctions set ref_function_init_Basics = function init_Basics set ref_function_init_GameTimer = function init_GameTimer set ref_function_init_ErrorHandling = function init_ErrorHandling set ref_function_init_Matrices = function init_Matrices set ref_function_init_Quaternion = function init_Quaternion set ref_function_init_Table = function init_Table set ref_function_init_Playercolor = function init_Playercolor set ref_function_init_Colors = function init_Colors set ref_function_init_Framehandle = function init_Framehandle set ref_function_init_Group = function init_Group set ref_function_init_Lightning = function init_Lightning set ref_function_init_WeatherEffects = function init_WeatherEffects set ref_function_init_TypeCasting = function init_TypeCasting set ref_function_init_HashList = function init_HashList set ref_function_init_EventHelper = function init_EventHelper set ref_function_init_AbilityObjEditing = function init_AbilityObjEditing set ref_function_init_AttachmentPoints = function init_AttachmentPoints set ref_function_init_BuffIds = function init_BuffIds set ref_function_init_Buildings = function init_Buildings set ref_function_init_ClosureForGroups = function init_ClosureForGroups set ref_function_init_LinkedList = function init_LinkedList set ref_function_init_ObjectIds = function init_ObjectIds set ref_function_init_TimerUtils = function init_TimerUtils set ref_function_init_ClosureTimers = function init_ClosureTimers set ref_function_init_UnitIds = function init_UnitIds set ref_function_init_MapBounds = function init_MapBounds set ref_function_init_Preloader = function init_Preloader set ref_function_init_ObjectIdGenerator = function init_ObjectIdGenerator set ref_function_init_Icons = function init_Icons set ref_function_init_ChannelAbilityPreset = function init_ChannelAbilityPreset set ref_function_init_RegisterEvents = function init_RegisterEvents set ref_function_init_Orders = function init_Orders set ref_function_init_OnUnitEnterLeave = function init_OnUnitEnterLeave set ref_function_init_UnitIndexer = function init_UnitIndexer set ref_function_init_ClosureEvents = function init_ClosureEvents set ref_function_init_Doodads = function init_Doodads set ref_function_init_DummyRecycler = function init_DummyRecycler set ref_function_init_InstantDummyCaster = function init_InstantDummyCaster set ref_function_init_ItemIds = function init_ItemIds set ref_function_init_Objects = function init_Objects set ref_function_init_Sounds = function init_Sounds set ref_function_init_Soundsets = function init_Soundsets set ref_function_init_StringUtils = function init_StringUtils set ref_function_init_Textures = function init_Textures set ref_function_init_UI = function init_UI set ref_function_init_Units = function init_Units set ref_function_init_nullclosurebug = function init_nullclosurebug set ref_function_code__onUnitIndex_ClosureEvents = function code__onUnitIndex_ClosureEvents set ref_function_code__onUnitDeindex_ClosureEvents = function code__onUnitDeindex_ClosureEvents set ref_function_EventListener_generalEventCallback = function EventListener_generalEventCallback set ref_function_code__Filter_ClosureForGroups = function code__Filter_ClosureForGroups set ref_function_code__startPeriodic_GameTimer = function code__startPeriodic_GameTimer set ref_function_code__registerPlayerUnitEvent_RegisterEvents = function code__registerPlayerUnitEvent_RegisterEvents set ref_function_code__onEnter_UnitIndexer = function code__onEnter_UnitIndexer set ref_function_code__onLeave_UnitIndexer = function code__onLeave_UnitIndexer set ref_function_code__addAction_nullclosurebug = function code__addAction_nullclosurebug set ref_function_code__addAction_nullTimer_ClosureEvents = function code__addAction_nullTimer_ClosureEvents set ref_function_code__addAction_nullTimer_ClosureEvents_173 = function code__addAction_nullTimer_ClosureEvents_138 set ref_function_code__addAction_nullTimer_ClosureEvents_174 = function code__addAction_nullTimer_ClosureEvents_139 set ref_function_code__registerPlayerUnitEvent_nullTimer_ClosureEvents = function code__registerPlayerUnitEvent_nullTimer_ClosureEvents set ref_function_code__start_CallbackSingle_ClosureTimers = function code__start_CallbackSingle_ClosureTimers set ref_function_code__Filter_registerEnterRegion_nullTimer_OnUnitEnterLeave = function code__Filter_registerEnterRegion_nullTimer_OnUnitEnterLeave set ref_function_code__registerPlayerUnitEvent_nullTimer_OnUnitEnterLeave = function code__registerPlayerUnitEvent_nullTimer_OnUnitEnterLeave set ref_function_code__ForGroup_nullTimer_OnUnitEnterLeave = function code__ForGroup_nullTimer_OnUnitEnterLeave endfunction function main takes nothing returns nothing local trigger initTrig call initGlobals() call ExecuteFunc("initCompiletimeState_0") set initTrig = CreateTrigger() call TriggerAddCondition(initTrig, Condition(ref_function_init_Abilities)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Abilities.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_AbilityIds)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package AbilityIds.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Real)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Real.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Integer)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Integer.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_BitSet)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package BitSet.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_String)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package String.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_TargetsAllowed)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package TargetsAllowed.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Angle)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Angle.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Vectors)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Vectors.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Destructable)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Destructable.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Player)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Player.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Maths)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Maths.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Printing)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Printing.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_MagicFunctions)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package MagicFunctions.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Basics)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Basics.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_GameTimer)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package GameTimer.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_ErrorHandling)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package ErrorHandling.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Matrices)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Matrices.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Quaternion)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Quaternion.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Table)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Table.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Playercolor)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Playercolor.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Colors)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Colors.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Framehandle)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Framehandle.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Group)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Group.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Lightning)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Lightning.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_WeatherEffects)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package WeatherEffects.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_TypeCasting)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package TypeCasting.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_HashList)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package HashList.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_EventHelper)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package EventHelper.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_AbilityObjEditing)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package AbilityObjEditing.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_AttachmentPoints)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package AttachmentPoints.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_BuffIds)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package BuffIds.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Buildings)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Buildings.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_ClosureForGroups)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package ClosureForGroups.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_LinkedList)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package LinkedList.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_ObjectIds)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package ObjectIds.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_TimerUtils)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package TimerUtils.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_ClosureTimers)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package ClosureTimers.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_UnitIds)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package UnitIds.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_MapBounds)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package MapBounds.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Preloader)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Preloader.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_ObjectIdGenerator)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package ObjectIdGenerator.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Icons)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Icons.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_ChannelAbilityPreset)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package ChannelAbilityPreset.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_RegisterEvents)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package RegisterEvents.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Orders)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Orders.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_OnUnitEnterLeave)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package OnUnitEnterLeave.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_UnitIndexer)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package UnitIndexer.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_ClosureEvents)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package ClosureEvents.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Doodads)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Doodads.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_DummyRecycler)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package DummyRecycler.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_InstantDummyCaster)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package InstantDummyCaster.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_ItemIds)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package ItemIds.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Objects)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Objects.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Sounds)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Sounds.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Soundsets)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Soundsets.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_StringUtils)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package StringUtils.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Textures)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Textures.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_UI)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package UI.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_Units)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package Units.") endif call TriggerClearConditions(initTrig) call TriggerAddCondition(initTrig, Condition(ref_function_init_nullclosurebug)) if not TriggerEvaluate(initTrig) then call error("Could not initialize package nullclosurebug.") endif call TriggerClearConditions(initTrig) call DestroyTrigger(initTrig) endfunction function config takes nothing returns nothing endfunction