summaryrefslogtreecommitdiffstats
path: root/pacman-c++/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pacman-c++/server.cpp')
-rw-r--r--pacman-c++/server.cpp32
1 files changed, 1 insertions, 31 deletions
diff --git a/pacman-c++/server.cpp b/pacman-c++/server.cpp
index 1c3caf9..e13682b 100644
--- a/pacman-c++/server.cpp
+++ b/pacman-c++/server.cpp
@@ -178,7 +178,7 @@ QPoint Server::addRandomPoint(Transmission::map_t map, Transmission::field_t typ
178 } 178 }
179 } 179 }
180 180
181 /* remove actors possitions from list 181 /* remove actors positions from list
182 * performance would be better if actors would be listed in visualMap too 182 * performance would be better if actors would be listed in visualMap too
183 * but this isn't possible that easily. see comment in updateMap(map) 183 * but this isn't possible that easily. see comment in updateMap(map)
184 */ 184 */
@@ -508,41 +508,11 @@ void Server::onRoundFinished()
508void Server::initRoundMap(bool firstPacket) 508void Server::initRoundMap(bool firstPacket)
509{ 509{
510 disconnect(this, SIGNAL(allPointsRemoved()), this, SLOT(onRoundFinished())); 510 disconnect(this, SIGNAL(allPointsRemoved()), this, SLOT(onRoundFinished()));
511 if (!firstPacket) {
512 // clear old map
513 for (unsigned int i=0; i<visualMap.size(); ++i) {
514 for (unsigned int j=0; j<visualMap[0].size(); ++j) {
515 GameEntity *e = visualMap[i][j];
516 if (e != NULL) {
517 if (qgraphicsitem_cast<Actor *>(e) == NULL) {
518 removeItem(e);
519 delete e;
520 }
521 }
522 visualMap[i][j] = 0;
523 }
524 }
525 }
526 511
527 // create new map 512 // create new map
528 Transmission::map_t map = Util::createDemoMap(); 513 Transmission::map_t map = Util::createDemoMap();
529 // add content 514 // add content
530 Util::placeActors(map, m_maxplayers, Color::order); 515 Util::placeActors(map, m_maxplayers, Color::order);
531 /*
532 if (!firstPacket) {
533 for (unsigned int i=0; i<Constants::map_size.width; ++i) {
534 for (unsigned int j=0; j<Constants::map_size.height; ++j) {
535 if (map[i][j] & Transmission::pacman) {
536 Color::Color color = static_cast<Color::Color>(map[i][j] & Transmission::color_mask);
537 Actor *actor = m_actors.value(color, NULL);
538 qDebug() << "setting actor to " << i << j << mapPositionToCoord(i, j);
539 actor->setPos(mapPositionToCoord(i, j));
540 }
541 }
542 }
543 }
544 */
545
546 Util::fillPoints(map); 516 Util::fillPoints(map);
547 517
548 /* save positions of blocks for later usage */ 518 /* save positions of blocks for later usage */