• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] If unit has item condition

Status
Not open for further replies.
Level 7
Joined
Jul 9, 2008
Messages
253
Hello Hiveworkshop,

I was just busy with a trigger and I was wondering if there is a non-BJ version of UnitHasItemOfTypeBJ. If there is, please let me know.

~Quetzalcotl
 
Level 7
Joined
May 13, 2011
Messages
310
I think that UnitHasItemOfType() exists. Googling "jass unithasitemoftype" yields plenty of results, so unless lots of people forgot to put BJ at the end, it should be a working function.

Copy the BJs' content into your own function and it is no longer BJ.

I don't know how that would help though. I don't think the only reason that Quetzalcotl wants a non-BJ alternative is so that he doesn't have to type the "BJ". I'm sure there is some difference in using BJ functions as opposed to non-BJ functions (although I don't yet know what it is).
 
Level 7
Joined
Jul 9, 2008
Messages
253
I appreciate the posts. I have tried UnitHasItemOfType() with the BJ but it gave an error so I guess it doesn't exist. The reason why I'd rather not use the BJ version is because I have been told that BJ's are inefficient.

~Quetzalcotl
 
Level 7
Joined
May 13, 2011
Messages
310
Hmm. It seems that UnitHasItemOfType() is a vJASS function, as you can see it's not highlighted in JASS tags:

JASS:
if UnitHasItemOfType(myUnit, myItemType) then
    //nyorgmashmorg
endif

Unlike UnitHasItemOfTypeBJ():

JASS:
if UnitHasItemOfTypeBJ(myUnit, myItemType) then
    //nyorgmashmorg
endif

If you want you can use vJASS just to do that, but if that's the only function you would compile in vJASS for, then I suggest just using UnitHasItemOfTypeBJ(), it should be fine.
 
Status
Not open for further replies.
Top