• 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] non-BJ

Status
Not open for further replies.
Level 40
Joined
Dec 14, 2005
Messages
10,532
JASS:
function TriggerRegisterAnyUnitEventBJ takes trigger trig, playerunitevent whichEvent returns nothing
    local integer index

    set index = 0
    loop
        call TriggerRegisterPlayerUnitEvent(trig, Player(index), whichEvent, null)

        set index = index + 1
        exitwhen index == bj_MAX_PLAYER_SLOTS
    endloop
endfunction
 
JASS:
function TriggerRegisterAnyUnitEventBJ takes trigger trig, playerunitevent whichEvent returns nothing
    local integer index

    set index = 0
    loop
        call TriggerRegisterPlayerUnitEvent(trig, Player(index), whichEvent, null)

        set index = index + 1
        exitwhen index == bj_MAX_PLAYER_SLOTS
    endloop
endfunction

Yet this still has a bj. :smile:
*bj_MAX_PLAYER_SLOTS*

I think you can just replace that.
 
Level 14
Joined
Nov 20, 2005
Messages
1,156
bj_MAX_PLAYER_SLOTS isn't a BJ FUNCTION. It's a BlizzardJass variable. I think it's 15 (well, should be). When using it, normally you don't need all 16 slots, though.

Non-array variables don't really have an impact on performance, unless used at least hundreds of times. Especially not important in things which only run once.
 
bj_MAX_PLAYER_SLOTS isn't a BJ FUNCTION. It's a BlizzardJass variable. I think it's 15 (well, should be). When using it, normally you don't need all 16 slots, though.

Non-array variables don't really have an impact on performance, unless used at least hundreds of times. Especially not important in things which only run once.

Damn. Ok, I checked the blizzard.j, it is a constant integer.

JASS:
    constant integer   bj_MAX_PLAYER_SLOTS              =  16

:wink:
 
Status
Not open for further replies.
Top