diff options
Diffstat (limited to 'src/game/client')
| -rw-r--r-- | src/game/client/components/menus.h | 1 | ||||
| -rw-r--r-- | src/game/client/components/menus_demo.cpp | 21 |
2 files changed, 3 insertions, 19 deletions
diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 6998acfe..1d9591bd 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -169,7 +169,6 @@ class CMenus : public CComponent void DemolistPopulate(); static void DemolistCountCallback(const char *pName, int IsDir, void *pUser); static void DemolistFetchCallback(const char *pName, int IsDir, void *pUser); - void DemoSetParentDirectory(); // found in menus.cpp int Render(); diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 2880da25..c5e6ee97 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -529,7 +529,9 @@ void CMenus::RenderDemoList(CUIRect MainView) { if(str_comp(m_lDemos[s_SelectedItem].m_aName, "..") == 0) //parent folder { - DemoSetParentDirectory(); + char aParentFolder[256]; + fs_parent_dir(m_aCurrentDemoFolder, aParentFolder); + str_copy(m_aCurrentDemoFolder, aParentFolder, sizeof(m_aCurrentDemoFolder)); DemolistPopulate(); s_SelectedItem = m_lDemos.size() > 0 ? 0 : -1; } @@ -568,20 +570,3 @@ void CMenus::RenderDemoList(CUIRect MainView) } } } - -void CMenus::DemoSetParentDirectory() -{ - int Stop = 0; - for(int i = 0; i < 256; i++) - { - if(m_aCurrentDemoFolder[i] == '/') - Stop = i; - } - - //keeps chars which are before the last '/' and remove chars which are after - for(int i = 0; i < 256; i++) - { - if(i >= Stop) - m_aCurrentDemoFolder[i] = '\0'; - } -} |