netpanzer-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netPanzer-CVS] netpanzer/src/NetPanzer Interfaces/GameConfig.c...


From: Hankin Chick
Subject: [netPanzer-CVS] netpanzer/src/NetPanzer Interfaces/GameConfig.c...
Date: Wed, 12 Nov 2003 06:26:01 -0500

CVSROOT:        /cvsroot/netpanzer
Module name:    netpanzer
Branch:         
Changes by:     Hankin Chick <address@hidden>   03/11/12 06:26:00

Modified files:
        src/NetPanzer/Interfaces: GameConfig.cpp 
        src/NetPanzer/Views/MainMenu/Multi: FlagSelectionView.cpp 

Log message:
        when starting the game for the first time randomize the flag.
        also randomize player name because "Player" is always taken on irc.

Patches:
Index: netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.16 
netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.17
--- netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.16      Tue Nov 11 
08:42:05 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp   Wed Nov 12 06:26:00 2003
@@ -16,6 +16,7 @@
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 #include <config.h>
+#include <sstream>
 
 #include "FileSystem.hpp"
 #include "Log.hpp"
@@ -53,7 +54,7 @@
       screengamma("gamma", 50, 0, 100),
 
       unitcolor("unitcolor", 0, 0, _color_last-1),
-      playerflag("playerflag", 0, 0, 100),
+      playerflag("playerflag", -1, -1, 100),
       attacknotificationtime("attacknotificationtime", 5, 0, 100),
       vehicleselectioncolor("vehicleselectioncolor", _color_blue, 0, 
_color_last-1),
       consoletextcolor("consoletextcolor", _color_white, 0, _color_last-1),
@@ -81,6 +82,9 @@
 
     //gamesettings.push_back(&hostorjoin);
 
+    std::stringstream default_player;
+    default_player << "Player" << (rand()%1000);
+    playername=default_player.str();
     playersettings.push_back(&playername);
     playersettings.push_back(&lobbyserver);
 
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp:1.15 
netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp:1.16
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp:1.15     
Thu Oct 23 20:22:26 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp  Wed Nov 
12 06:26:00 2003
@@ -95,6 +95,10 @@
     }
 
     playerFlag.setFrame(0);
+    if(gameconfig->playerflag<0) {
+        // new player, no flag...
+        gameconfig->playerflag=rand()%playerFlag.getFrameCount();
+    }
     playerFlagSelected = gameconfig->playerflag;
 
 } // end FlagSelectionView::init




reply via email to

[Prev in Thread] Current Thread [Next in Thread]