removed unnecessary weapons.xml write procedure from the ReadInWeaponStats function.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4489 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2011-06-09 15:34:57 +00:00
parent b8e5ebcf6c
commit 7ddd54134f
-102
View File
@@ -754,108 +754,6 @@ BOOLEAN ReadInWeaponStats(STR fileName)
MemFree(lpcBuffer);
#ifdef JA2TESTVERSION
//Debug code; make sure that what we got from the file is the same as what's there
// Open a new file
hFile = FileOpen( "TABLEDATA\\~Weapons out.xml", FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE );
SGP_THROW_IFFALSE(hFile, _BS(L"Couls not open/create file : ") << L"TABLEDATA\\~Weapons out.xml" << _BS::wget);
//if ( !hFile )
// return( FALSE );
{
UINT32 cnt;
FilePrintf(hFile,"<WEAPONLIST>\r\n");
for(cnt = 0;cnt < MAXITEMS;cnt++)
{
STR8 szRemainder = Weapon[cnt].szWeaponName; //the remaining string to be output (for making valid XML)
FilePrintf(hFile,"\t<WEAPON>\r\n");
FilePrintf(hFile,"\t\t<uiIndex>%d</uiIndex>\r\n", Weapon[cnt].uiIndex);
FilePrintf(hFile,"\t\t<szWeaponName>");
while(szRemainder[0] != '\0')
{
UINT32 uiCharLoc = strcspn(szRemainder,"&<>\'\"\0");
CHAR8 invChar = szRemainder[uiCharLoc];
if(uiCharLoc)
{
szRemainder[uiCharLoc] = '\0';
FilePrintf(hFile,"%s",szRemainder);
szRemainder[uiCharLoc] = invChar;
}
szRemainder += uiCharLoc;
switch(invChar)
{
case '&':
FilePrintf(hFile,"&amp;");
szRemainder++;
break;
case '<':
FilePrintf(hFile,"&lt;");
szRemainder++;
break;
case '>':
FilePrintf(hFile,"&gt;");
szRemainder++;
break;
case '\'':
FilePrintf(hFile,"&apos;");
szRemainder++;
break;
case '\"':
FilePrintf(hFile,"&quot;");
szRemainder++;
break;
}
}
FilePrintf(hFile,"</szWeaponName>\r\n");
FilePrintf(hFile,"\t\t<ubWeaponClass>%d</ubWeaponClass>\r\n", Weapon[cnt].ubWeaponClass);
FilePrintf(hFile,"\t\t<ubWeaponType>%d</ubWeaponType>\r\n", Weapon[cnt].ubWeaponType);
FilePrintf(hFile,"\t\t<ubCalibre>%d</ubCalibre>\r\n", Weapon[cnt].ubCalibre);
FilePrintf(hFile,"\t\t<ubReadyTime>%d</ubReadyTime>\r\n", Weapon[cnt].ubReadyTime);
FilePrintf(hFile,"\t\t<ubShotsPer4Turns>%d</ubShotsPer4Turns>\r\n", Weapon[cnt].ubShotsPer4Turns);
FilePrintf(hFile,"\t\t<ubShotsPerBurst>%d</ubShotsPerBurst>\r\n", Weapon[cnt].ubShotsPerBurst);
FilePrintf(hFile,"\t\t<ubBurstPenalty>%d</ubBurstPenalty>\r\n", Weapon[cnt].ubBurstPenalty);
FilePrintf(hFile,"\t\t<ubBulletSpeed>%d</ubBulletSpeed>\r\n", Weapon[cnt].ubBulletSpeed);
FilePrintf(hFile,"\t\t<ubImpact>%d</ubImpact>\r\n", Weapon[cnt].ubImpact);
FilePrintf(hFile,"\t\t<ubDeadliness>%d</ubDeadliness>\r\n", Weapon[cnt].ubDeadliness);
FilePrintf(hFile,"\t\t<bAccuracy>%d</bAccuracy>\r\n", Weapon[cnt].bAccuracy);
FilePrintf(hFile,"\t\t<nAccuracy>%d</nAccuracy>\r\n", Weapon[cnt].nAccuracy);
FilePrintf(hFile,"\t\t<ubMagSize>%d</ubMagSize>\r\n", Weapon[cnt].ubMagSize);
FilePrintf(hFile,"\t\t<usRange>%d</usRange>\r\n", Weapon[cnt].usRange);
FilePrintf(hFile,"\t\t<usReloadDelay>%d</usReloadDelay>\r\n", Weapon[cnt].usReloadDelay);
FilePrintf(hFile,"\t\t<ubAttackVolume>%d</ubAttackVolume>\r\n", Weapon[cnt].ubAttackVolume);
FilePrintf(hFile,"\t\t<ubHitVolume>%d</ubHitVolume>\r\n", Weapon[cnt].ubHitVolume);
FilePrintf(hFile,"\t\t<sSound>%d</sSound>\r\n", Weapon[cnt].sSound);
FilePrintf(hFile,"\t\t<sBurstSound>%d</sBurstSound>\r\n", Weapon[cnt].sBurstSound);
FilePrintf(hFile,"\t\t<sSilencedBurstSound>%d</sSilencedBurstSound>\r\n", Weapon[cnt].sSilencedBurstSound);
FilePrintf(hFile,"\t\t<sReloadSound>%d</sReloadSound>\r\n", Weapon[cnt].sReloadSound);
FilePrintf(hFile,"\t\t<sLocknLoadSound>%d</sLocknLoadSound>\r\n", Weapon[cnt].sLocknLoadSound);
FilePrintf(hFile,"\t\t<bBurstAP>%d</bBurstAP>\r\n", Weapon[cnt].bBurstAP);
FilePrintf(hFile,"\t\t<bAutofireShotsPerFiveAP>%d</bAutofireShotsPerFiveAP>\r\n", Weapon[cnt].bAutofireShotsPerFiveAP);
FilePrintf(hFile,"\t\t<APsToReloadManually>%d</APsToReloadManually>\r\n", Weapon[cnt].APsToReloadManually);
FilePrintf(hFile,"\t\t<ManualReloadSound>%d</ManualReloadSound>\r\n", Weapon[cnt].ManualReloadSound);
FilePrintf(hFile,"\t\t<ubAimLevels>%d</ubAimLevels>\r\n", Weapon[cnt].ubAimLevels);
FilePrintf(hFile,"\t\t<bRecoilX>%d</bRecoilX>\r\n", Weapon[cnt].bRecoilX);
FilePrintf(hFile,"\t\t<bRecoilY>%d</bRecoilY>\r\n", Weapon[cnt].bRecoilY);
FilePrintf(hFile,"\t\t<ubRecoilDelay>%d</ubRecoilDelay>\r\n", Weapon[cnt].ubRecoilDelay);
FilePrintf(hFile,"\t\t<Handling>%d</Handling>\r\n", Weapon[cnt].ubHandling);
FilePrintf(hFile,"\t</WEAPON>\r\n");
}
FilePrintf(hFile,"</WEAPONLIST>\r\n");
}
FileClose( hFile );
#endif
XML_ParserFree(parser);
return( TRUE );