Merged from revision: 7163

Externalized keys and locks to xml (by anv)
- Locks (TableData/Items/Locks.xml): Originally 64 locks were kept in BinaryData/LOCKS.BIN. Now up to 255 locks can be specified in TableData/Locks.xml. If it isn't found, LOCKS.BIN will be loaded normally.
- Keys (TableData/Items/Keys.xml): Originally 10 keys were hardcoded in KeyTable[]. Now up to 255 keys can be specified in TableData/Keys.xml. If it isn't found, hardcoded array will be used normally. 
see: http://www.bears-pit.com/board/ubbthreads.php/topics/331900.html

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7164 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2014-04-24 18:35:30 +00:00
parent aaaa144261
commit c9a9acec5c
17 changed files with 599 additions and 20 deletions
+15 -4
View File
@@ -5006,7 +5006,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
if( !LoadKeyTableFromSaveedGameFile( hFile ) )
if( !LoadKeyTableFromSaveedGameFile( hFile, guiCurrentSaveGameVersion ) )
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("LoadKeyTableFromSaveedGameFile failed" ) );
FileClose( hFile );
@@ -6541,10 +6541,21 @@ BOOLEAN LoadSoldierStructure( HWFILE hFile )
{
// WANNE - BMP: Check -> We get an assert here!
// Now Load the ....
FileRead( hFile, Menptr[ cnt ].pKeyRing, NUM_KEYS * sizeof( KEY_ON_RING ), &uiNumBytesRead );
if( uiNumBytesRead != NUM_KEYS * sizeof( KEY_ON_RING ) )
if( guiCurrentSaveGameVersion < MORE_LOCKS_AND_KEYS )
{
return(FALSE);
FileRead( hFile, Menptr[ cnt ].pKeyRing, NUM_KEYS_OLD * sizeof( KEY_ON_RING ), &uiNumBytesRead );
if( uiNumBytesRead != NUM_KEYS_OLD * sizeof( KEY_ON_RING ) )
{
return(FALSE);
}
}
else
{
FileRead( hFile, Menptr[ cnt ].pKeyRing, NUM_KEYS * sizeof( KEY_ON_RING ), &uiNumBytesRead );
if( uiNumBytesRead != NUM_KEYS * sizeof( KEY_ON_RING ) )
{
return(FALSE);
}
}
}