Zalinian
New Member
- Reaction score
- 0
[FIXED]Unit Group in struct not working.
I'm trying to set units within range of a unit matching certain conditions to a group. However the units are not being added in.
Condition function:
Block of code setting the group.
I checked with the debug, it detects the current target and its location fine, so its something with the condition, or something with the struct. I'm new to this so any help would be appreciated.
I also have this before the struct for use in the condition methods
The struct is called elementalist_wrath
I'm trying to set units within range of a unit matching certain conditions to a group. However the units are not being added in.
Condition function:
JASS:
static method lightning_chain_check takes nothing returns boolean
local elementalist_wrath this = temp_struct
return IsUnitAliveBJ(GetFilterUnit()) == true and GetFilterUnit() != (.l_current_target) and IsUnitEnemy(GetFilterUnit(), (.owner)) == true
endmethod
Block of code setting the group.
JASS:
call GroupEnumUnitsInRange(this.l_random_targets, GetUnitX(this.l_current_target), GetUnitY(this.l_current_target), 1000.00, Condition (function elementalist_wrath.lightning_chain_check))
set this.l_new_target = GroupPickRandomUnit(this.l_random_targets)
call BJDebugMsg(GetUnitName(this.l_new_target))
I checked with the debug, it detects the current target and its location fine, so its something with the condition, or something with the struct. I'm new to this so any help would be appreciated.
I also have this before the struct for use in the condition methods
JASS:
globals
elementalist_wrath temp_struct
endglobals
The struct is called elementalist_wrath