summaryrefslogtreecommitdiff
path: root/src/network/network.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-10-07 17:36:33 +0000
committerrubidium <rubidium@openttd.org>2009-10-07 17:36:33 +0000
commit58a36f038b7e668cde92d89630a2e8e32a67b2c3 (patch)
treed813aba3450c794ba9e0b4246be894af3710e137 /src/network/network.cpp
parentc53682810f4f6462840a3da9521e48d0bfd57e05 (diff)
downloadopenttd-58a36f038b7e668cde92d89630a2e8e32a67b2c3.tar.xz
(svn r17737) -Codechange: remove the chat window when you were chatting with someone who lost his/her connection or when you were team chatting and moved out of the company.
Diffstat (limited to 'src/network/network.cpp')
-rw-r--r--src/network/network.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 55794fa4d..5255b30ef 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -95,6 +95,15 @@ static ClientID _network_client_id = CLIENT_ID_FIRST;
extern void StateGameLoop();
/**
+ * Basically a client is leaving us right now.
+ */
+NetworkClientInfo::~NetworkClientInfo()
+{
+ /* Delete the chat window, if you were chatting with this client. */
+ InvalidateWindowData(WC_SEND_NETWORK_MSG, DESTTYPE_CLIENT, this->client_id);
+}
+
+/**
* Return the CI given it's raw index
* @param index the index to search for
* @return return a pointer to the corresponding NetworkClientInfo struct