]> Dogcows Code - chaz/carfire/commitdiff
small fix related to mouse button events
authorCharles <Charles@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Tue, 30 Mar 2010 01:25:11 +0000 (01:25 +0000)
committerCharles <Charles@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Tue, 30 Mar 2010 01:25:11 +0000 (01:25 +0000)
git-svn-id: https://bd85.net/svn/cs3505_group@39 92bb83a3-7c8f-8a45-bc97-515c4e399668

Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs

index 55d8b2e0a0d3df33920b8ac9da526ea642e36659..c69e2fb71fc6f2beb58cf66f0baed10eec3b2535 100644 (file)
@@ -368,7 +368,7 @@ namespace CS_3505_Project_06
 \r
 \r
         /// <summary>\r
-        /// Get the chat messages that have been receive since the last time this\r
+        /// Get the chat messages that have been received since the last time this\r
         /// method was called.\r
         /// </summary>\r
         /// <returns>List container of the chat messages.</returns>\r
@@ -398,6 +398,8 @@ namespace CS_3505_Project_06
         /// <param name="recipient">The gamer to receive the message.</param>\r
         public void SendChat(String message, NetworkGamer recipient)\r
         {\r
+            Debug.Assert(recipient != null && !recipient.IsDisposed);\r
+\r
             WriteChatPacket(message);\r
             LocalGamer.SendData(mPacketWriter, SendDataOptions.ReliableInOrder, recipient);\r
         }\r
@@ -890,13 +892,13 @@ namespace CS_3505_Project_06
                 events.Add(new MouseButtonEventInfo(LocalGamer, frameOfApplication, MouseButton.Left, leftButtonPressed));\r
             }\r
 \r
-            bool rightButtonPressed = mouseState.LeftButton == ButtonState.Pressed;\r
+            bool rightButtonPressed = mouseState.RightButton == ButtonState.Pressed;\r
             if (rightButtonPressed != mLastRightButtonPressed)\r
             {\r
                 events.Add(new MouseButtonEventInfo(LocalGamer, frameOfApplication, MouseButton.Right, rightButtonPressed));\r
             }\r
 \r
-            bool middleButtonPressed = mouseState.LeftButton == ButtonState.Pressed;\r
+            bool middleButtonPressed = mouseState.MiddleButton == ButtonState.Pressed;\r
             if (middleButtonPressed != mLastMiddleButtonPressed)\r
             {\r
                 events.Add(new MouseButtonEventInfo(LocalGamer, frameOfApplication, MouseButton.Middle, middleButtonPressed));\r
This page took 0.023443 seconds and 4 git commands to generate.