From: Charles Date: Tue, 30 Mar 2010 01:25:11 +0000 (+0000) Subject: small fix related to mouse button events X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=d4d977b0086ecf7ac950863cb0ecdd7e42804c43;p=chaz%2Fcarfire small fix related to mouse button events git-svn-id: https://bd85.net/svn/cs3505_group@39 92bb83a3-7c8f-8a45-bc97-515c4e399668 --- 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));