[prev in list] [next in list] [prev in thread] [next in thread] 

List:       atlantik-devel
Subject:    [atlantik-cvs]
From:       kde () office ! kde ! org
Date:       2003-10-10 2:13:36
[Download RAW message or body]

Update of /home/kde/kdegames/atlantik/libatlantikui
In directory office:/tmp/cvs-serv19064/libatlantikui

Modified Files:
	board.cpp 
Log Message:
bugfix: atlantikdesigner crashed on startup because it uses the board without a Core, \
have proper checks on whether the core exists

Index: board.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikui/board.cpp,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- board.cpp	14 Jul 2003 03:03:12 -0000	1.114
+++ board.cpp	10 Oct 2003 02:13:33 -0000	1.115
@@ -202,14 +202,14 @@
 		return;
 	}
 
-	Player *playerSelf = m_atlanticCore->playerSelf();
-	if (playerSelf)
+	Player *playerSelf = 0;
+	if (m_atlanticCore)
+		playerSelf = m_atlanticCore->playerSelf();
+
+	if (playerSelf && playerSelf->gameId() != player->gameId() )
 	{
-		if (playerSelf->gameId() != player->gameId())
-		{
-			kdDebug() << "addToken - not in same game" << endl;
-			return;
-		}
+		kdDebug() << "addToken ignored - not in same game as playerSelf" << endl;
+		return;
 	}
 	else
 		kdDebug() << "addToken - no playerSelf" << endl;
@@ -228,7 +228,9 @@
 {
 	kdDebug() << "playerChanged: playerLoc " << (player->location() ? \
player->location()->name() : "none") << endl;  
-	Player *playerSelf = m_atlanticCore->playerSelf();
+	Player *playerSelf = 0;
+	if (m_atlanticCore)
+		playerSelf = m_atlanticCore->playerSelf();
 
 	// Update token
 	Token *token = findToken(player);
@@ -371,6 +373,13 @@
 
 void AtlantikBoard::slotMoveToken()
 {
+	// Requires a core with estates to operate on
+	if (!m_atlanticCore)
+	{
+		kdDebug() << "slotMoveToken ignored - no atlanticCore" << endl;
+		return;
+	}
+
 	// Do we actually have a token to move?
 	if (!m_movingToken)
 	{

_______________________________________________
atlantik-cvs mailing list
atlantik-cvs@mail.kde.org
http://mail.kde.org/mailman/listinfo/atlantik-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic