From 088ec3e2f3ba0419612846db8f3687f5e2de1348 Mon Sep 17 00:00:00 2001 From: oy Date: Mon, 21 Feb 2011 11:23:30 +0100 Subject: made the client's map search work with sub folders. Closes #254 --- src/game/client/components/menus_demo.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/game/client/components/menus_demo.cpp') diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 5663bd85..92dd381d 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -427,14 +427,14 @@ int CMenus::UiDoListboxEnd(float *pScrollValue, bool *pItemActivated) return gs_ListBoxNewSelected; } -void CMenus::DemolistFetchCallback(const char *pName, int IsDir, int StorageType, void *pUser) +int CMenus::DemolistFetchCallback(const char *pName, int IsDir, int StorageType, void *pUser) { CMenus *pSelf = (CMenus *)pUser; int Length = str_length(pName); if((pName[0] == '.' && (pName[1] == 0 || (pName[1] == '.' && pName[2] == 0 && !str_comp(pSelf->m_aCurrentDemoFolder, "demos")))) || (!IsDir && (Length < 5 || str_comp(pName+Length-5, ".demo")))) - return; + return 0; CDemoItem Item; str_copy(Item.m_aFilename, pName, sizeof(Item.m_aFilename)); @@ -452,6 +452,8 @@ void CMenus::DemolistFetchCallback(const char *pName, int IsDir, int StorageType Item.m_IsDir = IsDir != 0; Item.m_StorageType = StorageType; pSelf->m_lDemos.add(Item); + + return 0; } void CMenus::DemolistPopulate() -- cgit 1.4.1