diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index e20052ca..229bbeea 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -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,"\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\r\n"); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].uiIndex); - - FilePrintf(hFile,"\t\t"); - 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,"&"); - szRemainder++; - break; - - case '<': - FilePrintf(hFile,"<"); - szRemainder++; - break; - - case '>': - FilePrintf(hFile,">"); - szRemainder++; - break; - - case '\'': - FilePrintf(hFile,"'"); - szRemainder++; - break; - - case '\"': - FilePrintf(hFile,"""); - szRemainder++; - break; - } - } - FilePrintf(hFile,"\r\n"); - - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubWeaponClass); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubWeaponType); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubCalibre); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubReadyTime); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubShotsPer4Turns); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubShotsPerBurst); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubBurstPenalty); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubBulletSpeed); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubImpact); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubDeadliness); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].bAccuracy); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].nAccuracy); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubMagSize); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].usRange); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].usReloadDelay); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubAttackVolume); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubHitVolume); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].sSound); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].sBurstSound); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].sSilencedBurstSound); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].sReloadSound); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].sLocknLoadSound); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].bBurstAP); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].bAutofireShotsPerFiveAP); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].APsToReloadManually); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ManualReloadSound); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubAimLevels); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].bRecoilX); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].bRecoilY); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubRecoilDelay); - FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubHandling); - FilePrintf(hFile,"\t\r\n"); - } - FilePrintf(hFile,"\r\n"); - } - FileClose( hFile ); -#endif - XML_ParserFree(parser); return( TRUE );