- Joined
- Dec 12, 2011
- Messages
- 116
Hello guys, I have a function that is not working well every time.
Sometimes, when I
Inside ForForce: 0
Inside ForForce: 1
Inside ForForce: 2
Inside ForForce: 3
Aftercount: 0
(The udg_myPlayerGroup really has got the players from 0 to 3)
Also, my udg_tempPlayerGroup is correctly initialized at Map Initialization as
Any ideas why this could happen?
PS: This does not fail everytime, only sometimes. And more, I didn't post the whole triggers where I call the function because I firstly want to receive some random ideas about why this could fail. I can post the triggers.
Thanks in advice,
hamsterpellet
JASS:
function TempPlayersGroupEnum takes nothing returns nothing
call BJDebugMsg("Inside ForForce: " + I2S(GetPlayerId(GetEnumPlayer())))
call ForceAddPlayer(udg_tempPlayerGroup, GetEnumPlayer())
endfunction
function TempPlayersGroup takes nothing returns nothing
call ForceClear(udg_tempPlayerGroup)
call ForForce(udg_myPlayerGroup, function TempPlayersGroupEnum)
call BJDebugMsg("Aftercount: " + I2S(CountPlayersInForceBJ(udg_tempPlayerGroup)))
endfunction
Sometimes, when I
call TempPlayersGroup()
I get the debug messages as following:Inside ForForce: 0
Inside ForForce: 1
Inside ForForce: 2
Inside ForForce: 3
Aftercount: 0
(The udg_myPlayerGroup really has got the players from 0 to 3)
Also, my udg_tempPlayerGroup is correctly initialized at Map Initialization as
CreateForce()
Any ideas why this could happen?
PS: This does not fail everytime, only sometimes. And more, I didn't post the whole triggers where I call the function because I firstly want to receive some random ideas about why this could fail. I can post the triggers.
Thanks in advice,
hamsterpellet