summaryrefslogtreecommitdiffstats
path: root/pacman-c++/server.cpp
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-05-03 01:00:51 +0200
committermanuel <manuel@mausz.at>2011-05-03 01:00:51 +0200
commite54ccad07e256ba877bd41d70bd358bd0085bd1e (patch)
tree4abe7d9af5784ad5f5bfbfc6cdab4c652912875a /pacman-c++/server.cpp
parentce94357ba958fd5692eadedab48f1f7d80dc0999 (diff)
downloadfoop-e54ccad07e256ba877bd41d70bd358bd0085bd1e.tar.gz
foop-e54ccad07e256ba877bd41d70bd358bd0085bd1e.tar.bz2
foop-e54ccad07e256ba877bd41d70bd358bd0085bd1e.zip
- add endless wait for players
- add eating order randomization
Diffstat (limited to 'pacman-c++/server.cpp')
-rw-r--r--pacman-c++/server.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/pacman-c++/server.cpp b/pacman-c++/server.cpp
index 962d1bf..2311c81 100644
--- a/pacman-c++/server.cpp
+++ b/pacman-c++/server.cpp
@@ -24,7 +24,7 @@ bool Server::run()
24 /* create eating order list first - this can also be created dynamically per round (theoretically) */ 24 /* create eating order list first - this can also be created dynamically per round (theoretically) */
25 for(unsigned int i = 0; i < m_maxplayers; ++i) 25 for(unsigned int i = 0; i < m_maxplayers; ++i)
26 m_eatingorder.append(Color::order[i]); 26 m_eatingorder.append(Color::order[i]);
27 m_eatingorder.append(Color::order[0]); 27 m_eatingorder.append(m_eatingorder.at(0));
28 28
29 m_tickTimer = new QTimer(this); 29 m_tickTimer = new QTimer(this);
30 m_tickTimer->setInterval(Constants::tick); 30 m_tickTimer->setInterval(Constants::tick);
@@ -604,6 +604,11 @@ void Server::initRoundMap()
604 /* reset scene and clean up items */ 604 /* reset scene and clean up items */
605 reset(); 605 reset();
606 606
607 /* randomize color eating order */
608 m_eatingorder.removeLast();
609 random_shuffle(m_eatingorder.begin(), m_eatingorder.end());
610 m_eatingorder.append(m_eatingorder.at(0));
611
607 /* create new map */ 612 /* create new map */
608 Transmission::map_t map = Util::createDemoMap(); 613 Transmission::map_t map = Util::createDemoMap();
609 Util::placeActors(map, m_maxplayers, Color::order); 614 Util::placeActors(map, m_maxplayers, Color::order);