bugfix: crash --> changeplayername if game wasnt started

This commit is contained in:
doitux
2007-01-28 21:19:00 +00:00
parent 7166a77d48
commit 20bb41240c
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -36,6 +36,8 @@ Game::Game(ConfigFile* c, GuiInterface* g, int qP, int sC, int sB) : myConfig(c)
// cout << "Create Game Object" << "\n";
int i;
actualHandID = 0;
for(i=0; i<myGui->getMaxQuantityPlayers(); i++) {
playerArray[i] = 0;
}
+3 -2
View File
@@ -492,8 +492,9 @@ void mainWindowImpl::callSettingsDialog() {
else { groupBox_tools->show(); }
//Falls Spielernamen geändert wurden --> neu zeichnen --> erst beim nächsten Neustart neu ausgelesen
if (v->getPlayerNickIsChanged()) {
cout << "wurst" << endl;
if (v->getPlayerNickIsChanged() && actualGame) {
actualHand->getPlayerArray()[0]->setMyName(v->lineEdit_humanPlayerName->text().toStdString());
actualHand->getPlayerArray()[1]->setMyName(v->lineEdit_Opponent1Name->text().toStdString());
actualHand->getPlayerArray()[2]->setMyName(v->lineEdit_Opponent2Name->text().toStdString());
actualHand->getPlayerArray()[3]->setMyName(v->lineEdit_Opponent3Name->text().toStdString());