Добавлен Феникс
Полагаю проблема в расчётах полёта
function move takes integer i returns nothing
local unit u = udg_unit[i] // дамми снаряда
local location p = GetUnitLoc(u)
local location p2 = udg_point[i] // таргет спелла
local real a
if DistanceBetweenPoints(p, p2) > 100 then
set a = AngleBetweenPoints(p, p2)
call MoveLocation(p, GetLocationX(p) + 10 * CosBJ(a), GetLocationY(p) + 10 * SinBJ(a))
call SetUnitPositionLoc( u, p )
else
call KillUnit( u )
set udg_unit[i] = udg_unit[udg_number]
set udg_point[i] = udg_point[udg_number]
set udg_i = udg_i-1
set udg_number = udg_number -1
call PolledWait(0.5)
call RemoveUnit(u)
endif
set u = null
call RemoveLocation(p)
call RemoveLocation(p2)
set p = null
set p2 = null
set a = 0
endfunction
Снаряд летит в центр карты, откуда бы я его не запустил.
Пробовал создавать даммика в точке каста и обозначать p2, как "GetUnitLoc(u2)" но проблема та же.
Принятый ответ
function move takes integer i returns nothing
local unit u = udg_unit[i] // дамми снаряда
local location p = GetUnitLoc(u)
local location p2 = udg_point[i] // таргет спелла
local real a
if DistanceBetweenPoints(p, p2) > 100 then
set a = AngleBetweenPoints(p, p2)
call MoveLocation(p, GetLocationX(p) + 10 * CosBJ(a), GetLocationY(p) + 10 * SinBJ(a))
call SetUnitPositionLoc( u, p )
else
call KillUnit( u )
call RemoveLocation(p2)
set udg_unit[i] = udg_unit[udg_number]
set udg_point[i] = udg_point[udg_number]
set udg_i = udg_i-1
set udg_number = udg_number -1
call PolledWait(0.5)
call RemoveUnit(u)
endif
set u = null
call RemoveLocation(p)
set p = null
set p2 = null
set a = 0
endfunction
Ты удалял точку сразу
`
ОЖИДАНИЕ РЕКЛАМЫ...
Чтобы оставить комментарий, пожалуйста, войдите на сайт.
Ред. 16GB
Ред. 16GB
Я переделал в твоей карте на них.