]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix the message 231/head
authorMario <zacjardine@y7mail.com>
Sun, 27 Sep 2015 03:37:53 +0000 (13:37 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 27 Sep 2015 03:37:53 +0000 (13:37 +1000)
qcsrc/common/minigames/minigame/snake.qc

index bfdd642a8988fa149fb126ba3dd2ef4761f9960c..16b28374eb925b1302697760d0d3bb5c093f1df1 100644 (file)
@@ -308,6 +308,10 @@ int snake_server_event(entity minigame, string event, ...)
                        {
                                WriteLong(MSG_ENTITY,sent.snake_score);
                        }
+                       else if ( sent.classname == "minigame" && (sf & MINIG_SF_UPDATE ) )
+                       {
+                               WriteByte(MSG_ENTITY,autocvar_sv_minigames_snake_wrap);
+                       }
                        return false;
                }
        }
@@ -321,6 +325,8 @@ int snake_server_event(entity minigame, string event, ...)
 vector snake_boardpos; // HUD board position
 vector snake_boardsize;// HUD board size
 
+bool snake_wrap;
+
 // Required function, draw the game board
 void snake_hud_board(vector pos, vector mySize)
 {
@@ -518,7 +524,10 @@ string snake_turn_to_string(int turnflags)
                return _("Press an arrow key to begin the game");
 
        if ( turnflags & SNAKE_TURN_MOVE )
-               return _("Avoid the walls and the snake's body, collect the mice!");
+               if(snake_wrap)
+                       return _("Avoid the snake's body, collect the mice!");
+               else
+                       return _("Avoid the screen edges and the snake's body, collect the mice!");
        
        return "";
 }
@@ -577,6 +586,7 @@ int snake_client_event(entity minigame, string event, ...)
                        {
                                if ( sf & MINIG_SF_UPDATE )
                                {
+                                       snake_wrap = ReadByte();
                                        sent.message = snake_turn_to_string(sent.minigame_flags);
                                        //if ( sent.minigame_flags & minigame_self.team )
                                                minigame_prompt();