mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
New feature: Voicesets are now independent fom profile slots. Voiceset is set in MercProfiles.xml with <usVoiceIndex>. IMP voices are defined in IMPVoices.xml.
This feature is savegame compatible. Requires GameDir >= r2357 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8364 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1626,6 +1626,15 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Flugente: voice set
|
||||
if ( guiCurrentSaveGameVersion >= SEPARATE_VOICESETS )
|
||||
{
|
||||
if ( !FileRead( hFile, &this->usVoiceIndex, sizeof(UINT32), &uiNumBytesRead ) )
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( this->uiProfileChecksum != this->GetChecksum() )
|
||||
@@ -1731,6 +1740,12 @@ BOOLEAN MERCPROFILESTRUCT::Save(HWFILE hFile)
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
// Flugente: voice set used
|
||||
if ( !FileWrite( hFile, &this->usVoiceIndex, sizeof(UINT32), &uiNumBytesWritten ) )
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -6677,6 +6692,12 @@ BOOLEAN LoadSavedMercProfiles( HWFILE hFile )
|
||||
// if not then overwrite with the previously stored data
|
||||
if ( gMercProfiles[cnt].bLifeMax <= 0 )
|
||||
gMercProfiles[cnt] = tempMercProfile;
|
||||
|
||||
/// Flugente: until the introduction of a separate varriable for the voiceset, the voice was identical with the slot
|
||||
if ( guiCurrentSaveGameVersion < SEPARATE_VOICESETS )
|
||||
{
|
||||
gMercProfiles[cnt].usVoiceIndex = cnt;
|
||||
}
|
||||
}
|
||||
|
||||
return( TRUE );
|
||||
|
||||
Reference in New Issue
Block a user