Skip to content

Commit

Permalink
Fix issue with saving cheats
Browse files Browse the repository at this point in the history
  • Loading branch information
fzurita committed Oct 10, 2015
1 parent 565f4c0 commit bdf15f2
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -21,6 +21,7 @@
package paulscode.android.mupen64plusae.cheat;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;

Expand Down Expand Up @@ -153,15 +154,20 @@ public void onExtractFinished(ArrayList<Cheat> moreCheats)
{
systemCheats.clear();
systemCheats.addAll( moreCheats );
systemCheats.addAll(userCheats);
}

private void save( String crc )
{
ArrayList<Cheat> combinedCheats;
combinedCheats = new ArrayList<Cheat>();
combinedCheats.addAll(systemCheats);
combinedCheats.addAll(userCheats);
Collections.sort(combinedCheats);

CheatFile usrcheat_txt = new CheatFile( mGlobalPrefs.customCheats_txt, true );
CheatFile mupencheat_txt = new CheatFile( mAppData.mupencheat_txt, true );
CheatUtils.save( crc, usrcheat_txt, userCheats, mRomHeaderName, mRomCountryCode, this, false );
CheatUtils.save( crc, mupencheat_txt, systemCheats, mRomHeaderName, mRomCountryCode, this, true );
CheatUtils.save( crc, mupencheat_txt, combinedCheats, mRomHeaderName, mRomCountryCode, this, true );
}

private boolean isHexNumber( String num )
Expand Down

0 comments on commit bdf15f2

Please sign in to comment.