// find tic tac toe piece given its tile name
entity ttt_find_piece(entity minig, string tile)
{
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_board_piece" && e.netname == tile )
return e;
- return world;
+ return NULL;
}
// Checks if the given piece completes a row
minigame.minigame_flags = TTT_TURN_PLACE | minigame.ttt_nexteam;
minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
minigame.ttt_npieces = 0;
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minigame) ) )
if ( e.classname == "minigame_board_piece" )
remove(e);
}
case "end":
{
- entity e = world;
+ entity e = NULL;
while( (e = findentity(e, owner, minigame)) )
if(e.classname == "minigame_board_piece")
{
for ( int i = 0; i < 9; i++ )
{
if ( piecemask & f )
- RandomSelection_Add(world, f, string_null, 1, 1);
+ RandomSelection_Add(NULL, f, string_null, 1, 1);
f <<= 1;
}
{
if ( minigame.minigame_flags == (TTT_TURN_PLACE|minigame.ttt_ai) )
{
- entity aiplayer = world;
+ entity aiplayer = NULL;
while ( ( aiplayer = findentity(aiplayer,owner,minigame) ) )
if ( aiplayer.classname == "minigame_player" && !aiplayer.minigame_playerslot )
break;