From d4d977b0086ecf7ac950863cb0ecdd7e42804c43 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 30 Mar 2010 01:25:11 +0000 Subject: [PATCH] small fix related to mouse button events git-svn-id: https://bd85.net/svn/cs3505_group@39 92bb83a3-7c8f-8a45-bc97-515c4e399668 --- .../CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs b/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs index 55d8b2e..c69e2fb 100644 --- a/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs +++ b/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs @@ -368,7 +368,7 @@ namespace CS_3505_Project_06 /// - /// Get the chat messages that have been receive since the last time this + /// Get the chat messages that have been received since the last time this /// method was called. /// /// List container of the chat messages. @@ -398,6 +398,8 @@ namespace CS_3505_Project_06 /// The gamer to receive the message. public void SendChat(String message, NetworkGamer recipient) { + Debug.Assert(recipient != null && !recipient.IsDisposed); + WriteChatPacket(message); LocalGamer.SendData(mPacketWriter, SendDataOptions.ReliableInOrder, recipient); } @@ -890,13 +892,13 @@ namespace CS_3505_Project_06 events.Add(new MouseButtonEventInfo(LocalGamer, frameOfApplication, MouseButton.Left, leftButtonPressed)); } - bool rightButtonPressed = mouseState.LeftButton == ButtonState.Pressed; + bool rightButtonPressed = mouseState.RightButton == ButtonState.Pressed; if (rightButtonPressed != mLastRightButtonPressed) { events.Add(new MouseButtonEventInfo(LocalGamer, frameOfApplication, MouseButton.Right, rightButtonPressed)); } - bool middleButtonPressed = mouseState.LeftButton == ButtonState.Pressed; + bool middleButtonPressed = mouseState.MiddleButton == ButtonState.Pressed; if (middleButtonPressed != mLastMiddleButtonPressed) { events.Add(new MouseButtonEventInfo(LocalGamer, frameOfApplication, MouseButton.Middle, middleButtonPressed)); -- 2.45.2