function MakeBridgeWalkable takes rect Vor, rect Nach returns nothing
local integer L = GetFreeMovingSFXIndex()
local integer I = 0
local integer Ptr
loop
exitwhen I > 15
if not HaveStoredInteger(WEUCache(),"PathingUnits" + I2S(I),"PlayerAttached") then
call StoreInteger(WEUCache(),"PathingUnits" + I2S(I),"PlayerAttached",Handle2Int(CreateGroup()))
endif
if not HaveStoredInteger(WEUCache(),"PathingTrigger" + I2S(I),"PlayerAttached") then
set Ptr = Handle2Int(CreateTrigger())
call StoreInteger(WEUCache(),"PathingTrigger" + I2S(I),"PlayerAttached",Ptr)
call TriggerRegisterPlayerSelectionEventBJ(Int2Trigger(Ptr),Player(I),true)
call TriggerAddAction(Int2Trigger(Ptr),function Bridge_Deselection)
call StoreBoolean(WEUCache(),"CurrentlyPathing" + I2S(I),"PlayerAttached",false)
endif
set I = I + 1
endloop
set udg_zz_MovingSFXKilled[L] = false
set udg_zz_MovingSFXTrigger[L] = CreateTrigger()
set udg_zz_MovingSFXVor[L] = Unit2Rect(CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'ncop',GetRectCenter(Vo r), bj_UNIT_FACING))
set udg_zz_MovingSFXNach[L] = Unit2Rect(CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'ncop',GetRectCenter(Na ch), bj_UNIT_FACING))
set udg_zz_MovingSFXCenter[L] = GetUnitLoc(Rect2Unit(udg_zz_MovingSFXNach[L]))
if GetTerrainCliffLevelBJ(GetUnitLoc(Rect2Unit(udg_zz_MovingSFXVor[L]))) > GetTerrainCliffLevelBJ(udg_zz_MovingSFXCenter[L]) then
set udg_zz_MovingSFXCenter[L] = GetUnitLoc(Rect2Unit(udg_zz_MovingSFXVor[L]))
endif
call UnitAddAbilityBJ('Ax2K',Rect2Unit(udg_zz_MovingSFXVor[L]))
call UnitAddAbilityBJ('Aivs',Rect2Unit(udg_zz_MovingSFXVor[L]))
call UnitAddAbilityBJ('Agho',Rect2Unit(udg_zz_MovingSFXVor[L]))
call SetUnitScalePercent(Rect2Unit(udg_zz_MovingSFXVor[L]),0.01,0.01,0.01)
call WaygateSetDestinationLocBJ(Rect2Unit(udg_zz_MovingSFXVor[L]),GetUnitLoc(Rect2Unit(udg_zz_MovingSFXNach[L])))
call WaygateActivate(Rect2Unit(udg_zz_MovingSFXVor[L]),true)
call UnitAddAbilityBJ('Ax2K',Rect2Unit(udg_zz_MovingSFXNach[L]))
call UnitAddAbilityBJ('Aivs',Rect2Unit(udg_zz_MovingSFXNach[L]))
call UnitAddAbilityBJ('Agho',Rect2Unit(udg_zz_MovingSFXNach[L]))
call SetUnitScalePercent(Rect2Unit(udg_zz_MovingSFXNach[L]),0.01,0.01,0.01)
call WaygateSetDestinationLocBJ(Rect2Unit(udg_zz_MovingSFXNach[L]),GetUnitLoc(Rect2Unit(udg_zz_MovingSFXVor[L])))
call WaygateActivate(Rect2Unit(udg_zz_MovingSFXNach[L]),true)
call TriggerRegisterUnitInRangeSimple(udg_zz_MovingSFXTrigger[L],120,Rect2Unit(udg_zz_MovingSFXVor[L]))
call TriggerRegisterUnitInRangeSimple(udg_zz_MovingSFXTrigger[L],120,Rect2Unit(udg_zz_MovingSFXNach[L]))
call TriggerAddCondition(udg_zz_MovingSFXTrigger[L],Condition(function Bridge_Conditions))
call TriggerAddAction(udg_zz_MovingSFXTrigger[L],function Bridge_Actions)
endfunction