AMAI
AMAI copied to clipboard
function add_exp
the remove_exp no function call , so the exp_number only increase, once the upper limit is reached, there will be problems ??
and even if call remove_exp , the exp_ancient and exp_creeps no reduction , they will still reach the upper limit
function remove_exp takes integer h returns nothing
local integer i = h
set exp_number = exp_number - 1
loop
exitwhen i >= exp_number
set exp_rp[i] = exp_rp[i + 1]
set exp_unit[i] = exp_unit[i + 1]
set exp_dist[i] = exp_dist[i + 1]
set i = i + 1
endloop
endfunction
function add_exp takes unit u, real dist, location ancient, group creeps returns nothing
set exp_unit[exp_number] = u
set exp_dist[exp_number] = dist
set exp_ancient[exp_number] = ancient
set exp_creeps[exp_number] = creeps
set exp_number = exp_number + 1
endfunction