Quick Jass Question

GooseBoy

New Member
Reaction score
2
JASS:
function GroupConditions1 takes nothing returns boolean
    if (IsUnitAlly(GetFilterUnit(),GetOwningPlayer(udg_Shadow_Hero) == true) then
        if(IsUnitIdType(GetUnitTypeId(GetFilterUnit()), UNIT_TYPE_HERO) == true) then
            if(GetUnitCurrentOrder(GetFilterUnit()) != String2OrderIdBJ("attack")) == true) then
                return true
            endif
        endif
    endif
    return false
endfunction


I want to pick all heroes that are not attacking and are allies of Shadow Hero. I wanted to ask if there is a better way of doing this?
 

Flare

Stops copies me!
Reaction score
662
JASS:
return IsUnitAlly(GetFilterUnit(),GetOwningPlayer(udg_Shadow_Hero)) and IsUnitType (GetFilterUnit (), UNIT_TYPE_HERO == true and GetUnitCurrentOrder(GetFilterUnit()) != String2OrderIdBJ(&quot;attack&quot;) //I don&#039;t know the native alternative to the String2OrderIdBJ, so I can&#039;t replace it for you <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue    :p" loading="lazy" data-shortname=":p" />
 

GooseBoy

New Member
Reaction score
2
but, i wanna know if my code is valid, i want to do it in a way so that i dont need to keep scrolling to the right on the Jass editor if i need to fix something, lol.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top