Init desired languages CVar on InitSram (#385)

* Properly init desired languages

* Fix typos
This commit is contained in:
Baoulettes 2022-05-29 17:55:50 +02:00 committed by GitHub
parent 83c07645f4
commit aaa1fafd51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -836,7 +836,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) {
for (i = 0; i < ARRAY_COUNTU(sZeldaMagic) - 3; i++) {
if (sZeldaMagic[i + SRAM_HEADER_MAGIC] != sramCtx->readBuff[i + SRAM_HEADER_MAGIC]) {
osSyncPrintf("SRAM破壊!!!!!!\n"); // "SRAM destruction! ! ! ! ! !"
gSaveContext.language = sramCtx->readBuff[SRAM_HEADER_LANGUAGE];
gSaveContext.language = CVar_GetS32("gLanguages", 0);
memcpy(sramCtx->readBuff, sZeldaMagic, sizeof(sZeldaMagic));
sramCtx->readBuff[SRAM_HEADER_LANGUAGE] = gSaveContext.language;
Sram_WriteSramHeader(sramCtx);
@ -845,7 +845,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) {
gSaveContext.audioSetting = sramCtx->readBuff[SRAM_HEADER_SOUND] & 3;
gSaveContext.zTargetSetting = sramCtx->readBuff[SRAM_HEADER_ZTARGET] & 1;
gSaveContext.language = sramCtx->readBuff[SRAM_HEADER_LANGUAGE];
gSaveContext.language = CVar_GetS32("gLanguages", 0);
if (gSaveContext.language >= LANGUAGE_MAX) {
gSaveContext.language = LANGUAGE_ENG;