]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/minigames/minigame/ttt.qc
Add cvars to enable / disable the dynamic hud effects for each panel
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / minigames / minigame / ttt.qc
index f2253c2a4b7c2da56fc7489a65b9829ac5389152..cd9565abd54ce2bf401b9459f33afa4ad4a25dd3 100644 (file)
@@ -1,3 +1,5 @@
+REGISTER_MINIGAME(ttt, "Tic Tac Toe");
+
 const int TTT_TURN_PLACE = 0x0100; // player has to place a piece on the board
 const int TTT_TURN_WIN   = 0x0200; // player has won
 const int TTT_TURN_DRAW  = 0x0400; // no moves are possible
@@ -293,7 +295,7 @@ void ttt_hud_status(vector pos, vector mySize)
                        if ( e.team == 2 )
                                mypos_y  += player_fontsize_y + ts_y;
                        minigame_drawcolorcodedstring_trunc(mySize_x,mypos,
-                               (e.minigame_playerslot ? GetPlayerName(e.minigame_playerslot-1) : _("AI")),
+                               (e.minigame_playerslot ? entcs_GetName(e.minigame_playerslot-1) : _("AI")),
                                player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
 
                        mypos_y += player_fontsize_y;
@@ -640,8 +642,7 @@ int ttt_client_event(entity minigame, string event, ...)
 
                                        if ( spawnai )
                                        {
-                                               entity aiplayer = spawn();
-                                               aiplayer.classname = "minigame_player";
+                                               entity aiplayer = new(minigame_player);
                                                aiplayer.owner = minigame;
                                                aiplayer.team = ai;
                                                aiplayer.minigame_playerslot = 0;