- Joined
- Dec 2, 2016
- Messages
- 733
I left out the part that calls this function, but basically it was working when I just had
'player1' / 'player2' etc are global units declared in another script
But when I added this part
It no longer kills the player and I believe is just waiting endlessly.
I'm trying to wait until this unit enters the map and when it does run the rest of the trigger klling the unit. What am I doing wrong here? Thanks. Full function below.
JASS:
'KillUnit(player1);'
'player1' / 'player2' etc are global units declared in another script
But when I added this part
JASS:
while (RectContainsUnit(GetEntireMapRect(), player1) == false ) {
TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 1));
KillUnit(player1);
}
}
It no longer kills the player and I believe is just waiting endlessly.
I'm trying to wait until this unit enters the map and when it does run the rest of the trigger klling the unit. What am I doing wrong here? Thanks. Full function below.
JASS:
function onLeaveHuman() {
player p = GetTriggerPlayer();
integer pid = GetPlayerId(p);
Bases.playerUnclaim(p);
if (GetTriggerPlayer() == Player(1)) {
while (RectContainsUnit(GetEntireMapRect(), player1) == false ) {
TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 1));
KillUnit(player1);
}
}
else if (GetTriggerPlayer() == Player(2)) {
while (RectContainsUnit(GetEntireMapRect(), player2) == false ) {
TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 1));
KillUnit(player2);
}
}
}