Fixed an issue with file IDs of additional game msg files being shifted when a file in ExtraGameMsgFileList is missing.

This commit is contained in:
NovaRain
2018-07-24 09:39:26 +08:00
parent f28a179c78
commit 9dce3c8d62
+3 -1
View File
@@ -118,6 +118,7 @@ void ReadExtraGameMsgFiles() {
int begin = 0; int begin = 0;
int end; int end;
int length; int length;
int number = 0;
while ((end = names.find_first_of(',', begin)) != std::string::npos) { while ((end = names.find_first_of(',', begin)) != std::string::npos) {
length = end - begin; length = end - begin;
@@ -127,10 +128,11 @@ void ReadExtraGameMsgFiles() {
MSGList* list = new MSGList; MSGList* list = new MSGList;
if (LoadMsgList(list, (char*)path.data()) == 1) if (LoadMsgList(list, (char*)path.data()) == 1)
gExtraGameMsgLists.insert(std::make_pair(0x2000 + gExtraGameMsgLists.size(), list)); gExtraGameMsgLists.insert(std::make_pair(0x2000 + number, list));
else else
delete list; delete list;
} }
number++;
begin = end + 1; begin = end + 1;
} }