- Joined
- Nov 28, 2008
- Messages
- 704
I have a simple question: is it an acceptable way to do an anti one player by causing a script to search for two different players who are playing? I know what the script is, it would invovle finding a player who is playing, then setting an integer to it, then looping through the other players until it finds one who is playing that isnt the first variable.
Thus, if only one player was playing, it would cause an infinite loop, crashing the game I am assuming, or else causing a thread death.
So, I have to ask.. is this an acceptable way? Does it violate any EULA, morals/ethics? Is it possible to fail, etc? I just thought I would ask because my map requires 2 players at least, and it randomly picks them to be different then the other players.. the way I have it WOULD in fact cause this if there was only one player.
Edit: I think it would help actually posting the code.
Thus, if only one player was playing, it would cause an infinite loop, crashing the game I am assuming, or else causing a thread death.
So, I have to ask.. is this an acceptable way? Does it violate any EULA, morals/ethics? Is it possible to fail, etc? I just thought I would ask because my map requires 2 players at least, and it randomly picks them to be different then the other players.. the way I have it WOULD in fact cause this if there was only one player.
Edit: I think it would help actually posting the code.
JASS:
local integer random1
local integer random2
set random1 = GetRandomInt(0, 9)
set random2 = ModuloInteger(random1 + GetRandomInt(0, 9), 9)
loop
exitwhen GetPlayerSlotState(Player(random2)) == PLAYER_SLOT_STATE_PLAYING
set random2 = ModuloInteger(random2 + 1, 9)
endloop
loop
exitwhen GetPlayerSlotState(Player(random1)) == PLAYER_SLOT_STATE_PLAYING and random1 != random2
set random1 = ModuloInteger(random1 + 1, 9)
endloop
Last edited: