| 69 | // assume no error, would be fatal in Starcraft anyway |
| 70 | } |
| 71 | int getFileType(const std::string &sFileName) |
| 72 | { |
| 73 | int rVal = 0; |
| 74 | Storm::CFile file; |
| 75 | |
| 76 | if ( !sFileName.empty() ) |
| 77 | { |
| 78 | // Open archive for map checking |
| 79 | Storm::CArchive archive(sFileName); |
| 80 | if ( archive ) |
| 81 | { |
| 82 | // Open scenario.chk file |
| 83 | if ( archive.openFile("staredit\\scenario.chk") ) |
| 84 | rVal = 1; |
| 85 | } |
| 86 | else if ( file.open(sFileName, SFILE_FROM_ABSOLUTE) ) |
| 87 | { |
| 88 | // Read file data to check if it's a replay |
| 89 | char tbuff[16]; |
| 90 | if ( file.read(tbuff, sizeof(tbuff)) && *(DWORD*)&tbuff[12] == 'SRer' ) |
| 91 | rVal = 2; |
| 92 | } |
| 93 | } |
| 94 | return rVal; |
| 95 | } |
| 96 | |
| 97 | //------------------------------------------------ BWAPI ERROR ----------------------------------------------- |
| 98 | void vBWAPIError(const char *format, va_list arg) |
no test coverage detected