Fixed crash when creating a network game.

This commit is contained in:
lotodore
2007-09-01 21:15:11 +00:00
parent b9aeb5497a
commit 096c02dd24
2 changed files with 6 additions and 1 deletions
@@ -15,7 +15,7 @@
#include "gamedata.h"
gameLobbyDialogImpl::gameLobbyDialogImpl(QWidget *parent, ConfigFile *c)
: QDialog(parent), myW(NULL), myConfig(c), currentGameName(""), isAdmin(false)
: QDialog(parent), myW(NULL), mySession(NULL), myConfig(c), currentGameName(""), isAdmin(false)
{
setupUi(this);
@@ -164,6 +164,7 @@ void gameLobbyDialogImpl::addConnectedPlayer(QString playerName, int rights) {
QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget_connectedPlayers,0);
item->setData(0, 0, playerName);
assert(mySession);
GameInfo info = mySession->getClientGameInfo(currentGameName.toUtf8().constData());
if(treeWidget_connectedPlayers->topLevelItemCount() != info.data.maxNumberOfPlayers) {