summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/OSSupport/NetworkSingleton.cpp5
-rw-r--r--src/UI/Window.cpp8
2 files changed, 12 insertions, 1 deletions
diff --git a/src/OSSupport/NetworkSingleton.cpp b/src/OSSupport/NetworkSingleton.cpp
index 358e24438..417fab01e 100644
--- a/src/OSSupport/NetworkSingleton.cpp
+++ b/src/OSSupport/NetworkSingleton.cpp
@@ -93,7 +93,6 @@ cNetworkSingleton & cNetworkSingleton::Get(void)
void cNetworkSingleton::Terminate(void)
{
ASSERT(!m_HasTerminated);
- m_HasTerminated = true;
// Wait for the LibEvent event loop to terminate:
event_base_loopbreak(m_EventBase);
@@ -113,6 +112,10 @@ void cNetworkSingleton::Terminate(void)
event_base_free(m_EventBase);
libevent_global_shutdown();
+
+ // Set the HasTerminated flag:
+ // (Only set the flag after everything has been removed, to avoid the random failures in the Google-test, caused by links terminating after this flag was set)
+ m_HasTerminated = true;
}
diff --git a/src/UI/Window.cpp b/src/UI/Window.cpp
index 61e25651b..dbdcbeaa8 100644
--- a/src/UI/Window.cpp
+++ b/src/UI/Window.cpp
@@ -605,6 +605,10 @@ void cWindow::OnLeftPaintEnd(cPlayer & a_Player)
}
SendWholeWindow(*a_Player.GetClientHandle());
+
+ // To fix #2345 (custom recipes don't work when inventory-painting), we send the result slot explicitly once again
+ // This is a fix for what seems like a client-side bug
+ a_Player.GetClientHandle()->SendInventorySlot(m_WindowID, 0, *GetSlot(a_Player, 0));
}
@@ -629,6 +633,10 @@ void cWindow::OnRightPaintEnd(cPlayer & a_Player)
}
SendWholeWindow(*a_Player.GetClientHandle());
+
+ // To fix #2345 (custom recipes don't work when inventory-painting), we send the result slot explicitly once again
+ // This is a fix for what seems like a client-side bug
+ a_Player.GetClientHandle()->SendInventorySlot(m_WindowID, 0, *GetSlot(a_Player, 0));
}