Several fixes for binary stream
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2021-07-09 14:18:26 +02:00
parent 9424a209ec
commit 4c9d472f10
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 4 additions and 4 deletions

View File

@ -20,10 +20,10 @@ public:
// We serialize our types in the format // We serialize our types in the format
// "[category(byte)][name(str)]\2[decl(str)]\2[name(str)]\2[decl(str)]\1[category(byte)]...." // "[category(byte)][name(str)]\2[decl(str)]\2[name(str)]\2[decl(str)]\1[category(byte)]...."
ScriptCategory categoryArr[1]; i16 categoryArr[1];
for (const auto& dic : types) { for (const auto& dic : types) {
// Write the category // Write the category
categoryArr[0] = dic.first; categoryArr[0] = (i16)dic.first;
Write(categoryArr, sizeof(i16)); Write(categoryArr, sizeof(i16));
for (const auto& inner : dic.second) { for (const auto& inner : dic.second) {
// Write the script name // Write the script name
@ -40,7 +40,7 @@ public:
Write("\1", sizeof(char)); Write("\1", sizeof(char));
} }
categoryArr[0] = (ScriptCategory)-1; categoryArr[0] = (i16)-1;
Write(categoryArr, sizeof(i16)); Write(categoryArr, sizeof(i16));
for (const auto& inner : itemUseTypes) { for (const auto& inner : itemUseTypes) {
// Write the script name // Write the script name
@ -56,7 +56,7 @@ public:
// Write the divider between categories. // Write the divider between categories.
Write("\1", sizeof(char)); Write("\1", sizeof(char));
categoryArr[0] = (ScriptCategory)-2; categoryArr[0] = (i16)-2;
Write(categoryArr, sizeof(i16)); Write(categoryArr, sizeof(i16));
for (const auto& inner : evolutionTypes) { for (const auto& inner : evolutionTypes) {
// Write the script name // Write the script name