This error came out of nowhere and I have no idea what the error is. It was working fine yesterday, but suddenly it appeared.
Here are the 2 codes involved.
Hidden information:
JASS:
scope Team1CP2
globals
integer count = 0
boolean Kill = false
endglobals
private function Spike takes nothing returns nothing
local timer t = GetExpiredTimer ()
local unit a = CreateUnit ( Player (10 ), 'u000' , GetUnitX (gg_unit_u001_0009 ), GetUnitY (gg_unit_u001_0009 ), 0 )
call SpikeMove (a )
set count = count + 1
if udg_ModePro == true then
if count == 50 then
call ReleaseTimer (t )
endif
else
if count == 40 then
call ReleaseTimer (t )
endif
endif
set a = null
endfunction
private function Actions takes nothing returns nothing
local timer t = NewTimer ()
if Kill == false then
set Kill = true
if udg_ModePro == true then
call TimerStart ( t , 1.5 , true , function Spike )
else
call TimerStart ( t , 2.5 , true , function Spike )
endif
endif
endfunction
public function InitTrig takes nothing returns nothing
local trigger t = CreateTrigger ()
call TriggerRegisterEnterRectSimple ( t , gg_rct_Team1CP2 )
call TriggerAddAction ( t , function Actions )
endfunction
endscope
JASS:
library MoveSpike uses CSSafety , ABC
struct spike
unit a
method onDestroy takes nothing returns nothing
call RemoveUnit (.a )
endmethod
endstruct
private function SpikeMoveFunctions takes nothing returns nothing
local timer t = GetExpiredTimer ()
local spike dat = GetTimerStructA (t )
local unit a = dat.a
local real x = GetUnitX (a )
local real y = GetUnitY (a )
if GetOwningPlayer (a ) == Player (10 ) then
if IsUnitInRange ( a , gg_unit_u001_0010 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0008 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0008 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0011 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0007 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0007 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0012 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0006 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0006 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0013 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0073 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0073 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0014 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0020 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0020 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0015 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0021 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0021 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0016 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0022 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0022 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0017 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0023 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0023 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0018 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0024 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0024 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0019 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0025 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0025 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0034 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0026 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0026 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0035 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0027 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0027 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0036 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0028 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0028 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0037 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0029 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0029 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0033 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0030 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0030 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0032 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0069 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0069 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0031 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0009 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0009 ) )
else
call SetUnitPosition (a , x + udg_DIAGNAL_X , y - udg_DIAGNAL_Y )
endif
if udg_Stop1 then
call dat.destroy ()
call ReleaseTimer (t )
set a = null
endif
elseif GetOwningPlayer (a ) == Player (11 ) then
if IsUnitInRange ( a , gg_unit_u001_0042 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0040 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0040 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0043 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0039 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0039 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0044 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0038 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0038 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0047 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0074 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0074 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0048 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0045 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0045 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0049 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0046 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0046 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0054 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0050 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0050 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0055 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0051 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0051 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0057 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0052 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0052 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0058 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0053 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0053 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0059 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0056 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0056 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0060 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0072 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0072 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0061 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0071 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0071 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0062 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0070 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0070 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0063 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0067 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0067 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0064 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0068 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0068 ) )
elseif IsUnitInRange ( a , gg_unit_u001_0065 , 60 ) then
call SetUnitX (a , GetUnitX (gg_unit_u001_0041 ) )
call SetUnitY (a , GetUnitY (gg_unit_u001_0041 ) )
else
call SetUnitPosition (a , x - udg_DIAGNAL_X , y - udg_DIAGNAL_Y )
endif
if udg_Stop2 then
call dat.destroy ()
call ReleaseTimer (t )
set a = null
endif
endif
endfunction
function SpikeMove takes unit a returns nothing
local timer t = NewTimer ()
local spike dat = spike.create ()
local real count
set dat.a = a
if udg_ModeNormal then
set count = 1
elseif udg_ModeNormal then
set count = 0.5
elseif udg_ModePro then
set count = 0.25
endif
call SetTimerStructA ( t , dat )
call TimerStart ( t , count , true , function SpikeMoveFunctions )
endfunction
endlibrary