Hi everyone. Here's the code of trigger's Actions function:
I tried to use GetUnitLoc() instead of Location() but the result is the same. How this can be fixed?
JASS:
local integer i=0
local location loc
local unit u=GetSpellAbilityUnit()
set i=GetPlayerId(GetOwningPlayer(u))
call DisplayTextToPlayer(Player(i),0,0,I2S(GetUnitTypeId(u)))
if RectContainsCoords(udg_INV_LOCS[i], GetUnitX(u), GetUnitY(u)) then
//Moves unit not to the udg_inv_TP[i] but to (0; 0)
call SetUnitX(u,GetLocationX(udg_inv_TP[i]))
call SetUnitY(u,GetLocationY(udg_inv_TP[i]))
else
set loc=Location(GetUnitX(u),GetUnitY(u))
set udg_inv_TP[i]=loc
call SetUnitX(u,GetRectCenterX(udg_INV_LOCS[i]))
call SetUnitY(u,GetRectCenterY(udg_INV_LOCS[i]))
endif
call PanCameraToTimedForPlayer(GetOwningPlayer(u),GetUnitX(u),GetUnitY(u),0.)
call RemoveLocation(loc)
set loc=null
set u=null