const int TTT_SF_PLAYERSCORE = MINIG_SF_CUSTOM; // send minigame_player scores (won matches)
const int TTT_SF_SINGLEPLAYER = MINIG_SF_CUSTOM<<1;// send minigame.ttt_ai
+const int TTT_SPECTATOR_TEAM = 255; // must be above max teams and equal to or below 255
+
const int TTT_LET_CNT = 3;
const int TTT_NUM_CNT = 3;
const int TTT_TILE_SIZE = 3;
return false;
// Don't allow more than 2 players
- if(pl_num >= 2) { return false; }
+ if(pl_num >= 2) { return TTT_SPECTATOR_TEAM; }
// Get the right team
if(minigame.minigame_players)
}
case "cmd":
{
+ entity player = ...(0,entity);
+ bool event_blocked = (player.team == TTT_SPECTATOR_TEAM);
switch(argv(0))
{
case "move":
+ if(event_blocked)
+ return true;
ttt_move(minigame, ...(0,entity), ...(1,int) == 2 ? argv(1) : string_null );
return true;
case "next":
+ if(event_blocked)
+ return true;
ttt_next_match(minigame,...(0,entity));
return true;
case "singleplayer":
+ if(event_blocked)
+ return true;
if ( minigame_count_players(minigame) == 1 )
{
minigame.ttt_ai = minigame_next_team(minigame.minigame_players.team, 2);
entity e;
FOREACH_MINIGAME_ENTITY(e)
{
- if ( e.classname == "minigame_player" )
+ if ( e.classname == "minigame_player" && e.team != TTT_SPECTATOR_TEAM )
{
mypos = pos;
if ( e.team == 2 )
// Turn a set of flags into a help message
string ttt_turn_to_string(int turnflags)
{
+ if(minigame_self.team == TTT_SPECTATOR_TEAM)
+ return _("You are spectating");
+
if ( turnflags & TTT_TURN_DRAW )
return _("Draw");