Nestharus
o-o
- Reaction score
- 84
I fixed this up to all the specifications a long time ago..
When do you plan on ungraveyarding this??
Found one error- TriggerRegisterEvent on a trigger that doesn't exist o-o, which has been fixed. Also updated it to use the below. Build 5.2
While writing my JASS guide, I found this to be an interesting way to check to see if a player is in the game or not-
[ljass]if GetPlayerTeam(player) != -1 {}[/ljass]
It proved to be faster than the normal slot check method =). Once a player is verified with this method, the player owner will be checked and it'll be categorized into the utility =).
Benchmark Code
Build 5.3 will be a cJASS implementation which will feature:
less of a code impact on the compiled map script
As for optimization, I will always continue to try and make this better. I am really unsure what else I can do though o-o.
When do you plan on ungraveyarding this??
Found one error- TriggerRegisterEvent on a trigger that doesn't exist o-o, which has been fixed. Also updated it to use the below. Build 5.2
While writing my JASS guide, I found this to be an interesting way to check to see if a player is in the game or not-
[ljass]if GetPlayerTeam(player) != -1 {}[/ljass]
It proved to be faster than the normal slot check method =). Once a player is verified with this method, the player owner will be checked and it'll be categorized into the utility =).
Benchmark Code
JASS:
include "cj_types.j"
include "cj_typesEx.j"
include "cj_print.j"
include "cj_types_priv.j"
include "cj_typesEx_priv.j"
include "cj_order.j"
include "cj_antibj_base.j"
scope Demo initializer Initialization {
trigger t = CreateTrigger()
event e = TriggerRegisterTimerEvent(t, 0, false)
int sw, i = 5000; float mark
bool Test() {
sw = StopWatchCreate()
do {
if GetPlayerTeam(Player(0)) != -1 {} //.007
//if GetPlayerSlotState(Player(0)) == PLAYER_SLOT_STATE_PLAYING {} //.011
} whilenot --i == 0
mark = StopWatchMark(sw)
StopWatchDestroy(sw)
printf(R2S(mark))
return false
}
void Initialization() {
TriggerAddCondition(t, Condition(function Test))
}
}
Build 5.3 will be a cJASS implementation which will feature:
less of a code impact on the compiled map script
As for optimization, I will always continue to try and make this better. I am really unsure what else I can do though o-o.