From 54f469c84e192f832b29775b3648478e7d107233 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 20 Feb 2005 05:00:56 +0000 Subject: [PATCH] write extra mappings don't write empty fields --- stepmania/src/InputMapper.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index c93d514f16..b45004ec1e 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -434,17 +434,20 @@ void InputMapper::SaveMappingsToDisk() ini.DeleteKey( GAMESTATE->GetCurrentGame()->m_szName ); // iterate over our input map and write all mappings to the ini file - for( int i=0; i asValues; + for( unsigned button = 0; button < NUM_GAME_TO_DEVICE_SLOTS; ++button ) + asValues.push_back( m_GItoDI[i][j][button].toString() ); + while( asValues.size() && asValues.back() == "" ) + asValues.erase( asValues.begin()+asValues.size()-1 ); + CString sValueString = join( ",", asValues ); + ini.SetValue( GAMESTATE->GetCurrentGame()->m_szName, sNameString, sValueString ); } }