Fixed legacy parser not extracting ITM counts correctly.

This commit is contained in:
WrinklyNinja
2014-01-13 23:56:13 +00:00
parent ba8c57e504
commit 1bab8cbdb1
2 changed files with 25 additions and 3 deletions
+20 -2
View File
@@ -188,9 +188,27 @@ make
## Using The Masterlist Converter
The `masterlist-converter.exe` expects a v2 masterlist named `masterlist.txt` to be present in the same directory as it, and produces a v3 masterlist named `masterlist.txt.yaml`.
The masterlist converter is a command line utility that takes two optional command line arguments:
The converter is a command line utility and will print any errors in encounters to the console. It also won't create a v3 masterlist file if errors are encountered.
```
masterlist-converter.exe [v2 masterlist input file] [v3 masterlist output file]
```
If only one argument is given, or if no arguments are given, the converter assumes it was called as
```
masterlist-converter.exe masterlist.txt masterlist.yaml
```
On encountering an error, it will print an error message to the console, and will not output a v3 masterlist.
The converter does not perform a lossless conversion. The following do not get transferred into the new masterlist:
* Silent comments.
* Requirement messages containing plugin filenames.
* Dirty message content. The ITM, UDR and Navmesh counts, along with CRCs and the dirty utility referenced are transferred, but any additional content, such as links to additional instructions, are lost.
In addition, while other data is retained, it needs some manual adjustment, eg. translated messages need are converted as separate messages and should be placed into message content objects.
## Packaging Releases
+5 -1
View File
@@ -614,7 +614,10 @@ namespace boss {
//Extract ITM count.
pos1 = content.find("ITM");
if (pos1 != std::string::npos) {
itm = atoi(content.substr(0, pos1).c_str());
pos2 = content.rfind(':', pos1);
if (pos2 != std::string::npos) {
itm = atoi(content.substr(pos2+1, pos1-pos2-1).c_str());
}
}
//Extract UDR count.
@@ -648,6 +651,7 @@ namespace boss {
}
dirtyInfo.insert(PluginDirtyInfo(crc, itm, udr, 0, utility));
it = messages.erase(it);
} else
++it;
} else