RandomUser1
Member
- Reaction score
- 0
Firstly i'd like to say i tried to create this in the JASS area but everytime i click Create a New etc.. it says "502 BadGateway".
Anyway i just have a quick question. Which is better. NOTE: There are multiple Elseif's i just cut it to make this short but there are about 18 Arenas a player can claim.
I am "assuming" that it would be better to just register the unit location x, y first as a local as opposed to checking it in every elseif . . .
instead of the trigger constantly checking the location of x, y?
Anyway i just have a quick question. Which is better. NOTE: There are multiple Elseif's i just cut it to make this short but there are about 18 Arenas a player can claim.
JASS:
local player p = GetTriggerPlayer()
local integer i = GetPlayerId(p) + 1
local real x = GetLocationX(GetUnitLoc(udg_Hero<i>))
local real y = GetLocationY(GetUnitLoc(udg_Hero<i>))
if RectContainsCoords(gg_rct_B1, x, y) then
if udg_ArenaClaimed[1] == false and udg_PlayerOwnsArena == 0 then
</i></i>
I am "assuming" that it would be better to just register the unit location x, y first as a local as opposed to checking it in every elseif . . .
JASS:
local player p = GetTriggerPlayer()
local integer i = GetPlayerId(p) + 1
if RectContainsCoords(gg_rct_B1, GetUnitX(udg_Hero<i>), GetUnitY(udg_Hero<i>)) then
if udg_ArenaClaimed[1] == false and udg_PlayerOwnsArena == 0 then
</i></i>
instead of the trigger constantly checking the location of x, y?