summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzuu <zuu@openttd.org>2015-12-10 19:58:33 +0000
committerzuu <zuu@openttd.org>2015-12-10 19:58:33 +0000
commitb22d6715cd1510fd6d380a6c4c675744d9b9f5dc (patch)
treef22c3aca243018a284cecaf29df37bdd62eec88d
parentaabc46712a8df13f7b58b53d366dbaa810535687 (diff)
downloadopenttd-b22d6715cd1510fd6d380a6c4c675744d9b9f5dc.tar.xz
(svn r27469) -Fix (r27468): Don't fetch all content info from content server when showing a online content window with exactly one type of content.
-rw-r--r--src/network/network_content_gui.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index ce20239ed..1227d43db 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -1138,6 +1138,7 @@ static WindowDesc _network_content_list_desc(
* @param cv the content to show, or NULL when it has to search for itself
* @param type1 the first type to (only) show or #CONTENT_TYPE_END to show all.
* @param type2 the second type to (only) show in addition to type1. If type2 is != #CONTENT_TYPE_END, then also type1 should be != #CONTENT_TYPE_END.
+ * If type2 != #CONTENT_TYPE_END, then type1 != type2 must be true.
*/
void ShowNetworkContentListWindow(ContentVector *cv, ContentType type1, ContentType type2)
{
@@ -1146,8 +1147,9 @@ void ShowNetworkContentListWindow(ContentVector *cv, ContentType type1, ContentT
_network_content_client.Clear();
if (cv == NULL) {
assert(type1 != CONTENT_TYPE_END || type2 == CONTENT_TYPE_END);
+ assert(type1 == CONTENT_TYPE_END || type1 != type2);
_network_content_client.RequestContentList(type1);
- if (type2 != type1) _network_content_client.RequestContentList(type2);
+ if (type2 != CONTENT_TYPE_END) _network_content_client.RequestContentList(type2);
if (type1 != CONTENT_TYPE_END) types[type1] = true;
if (type2 != CONTENT_TYPE_END) types[type2] = true;