mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
Source v1.13 Mod High Resolution version from 2006-04-19
********************************************************* * 2006/04/19 * * Madd_Mugsy * * Developed in VS 2003 * ********************************************************* - Restored the ?accurate? and ?inaccurate? strings that Rowa21 overwrote ;) - IMP.dat file changed to save a different file for each IMP - Different existing IMPs can be loaded by typing their names in the IMP webpage git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@28 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+13
-4
@@ -33,7 +33,7 @@
|
||||
#include "strategic.h"
|
||||
#endif
|
||||
|
||||
#define IMP_MERC_FILE "IMP.dat"
|
||||
#define IMP_FILENAME_SUFFIX ".dat"
|
||||
|
||||
IMP_ITEM_CHOICE_TYPE gIMPItemChoices[MAX_IMP_ITEM_TYPES];
|
||||
|
||||
@@ -657,7 +657,7 @@ void WriteOutCurrentImpCharacter( INT32 iProfileId )
|
||||
UINT32 uiBytesWritten = 0;
|
||||
|
||||
// open the file for writing
|
||||
hFile = FileOpen(IMP_MERC_FILE, FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE);
|
||||
hFile = FileOpen(strcat((STR)(&gMercProfiles[iProfileId].zNickname),IMP_FILENAME_SUFFIX), FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE);
|
||||
|
||||
// write out the profile id
|
||||
if (!FileWrite(hFile, &iProfileId, sizeof( INT32 ), &uiBytesWritten))
|
||||
@@ -683,14 +683,23 @@ void WriteOutCurrentImpCharacter( INT32 iProfileId )
|
||||
return;
|
||||
}
|
||||
|
||||
void LoadInCurrentImpCharacter( void )
|
||||
BOOLEAN ImpExists ( STR nickName )
|
||||
{
|
||||
DWORD attribs = GetFileAttributes(strcat(nickName,IMP_FILENAME_SUFFIX));
|
||||
if ( attribs != INVALID_FILE_ATTRIBUTES && !(attribs & FILE_ATTRIBUTE_DIRECTORY) )
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void LoadImpCharacter( STR nickName )
|
||||
{
|
||||
INT32 iProfileId = 0;
|
||||
HWFILE hFile;
|
||||
UINT32 uiBytesRead = 0;
|
||||
|
||||
// open the file for writing
|
||||
hFile = FileOpen(IMP_MERC_FILE, FILE_ACCESS_READ, FALSE);
|
||||
hFile = FileOpen(strcat(nickName,IMP_FILENAME_SUFFIX), FILE_ACCESS_READ, FALSE);
|
||||
|
||||
// valid file?
|
||||
if( hFile == -1 )
|
||||
|
||||
Reference in New Issue
Block a user