# HG changeset patch # User Ritor1 # Date 1394295807 -21600 # Node ID f38f53397bc0d266f526877335c30b2fbb1973ee # Parent 47b87aea14ba4ae07d0e5e89db05374398ee63b7# Parent 236d8d7c72955670eb7ede6d99eed1da9658cb74 Слияние diff -r 47b87aea14ba -r f38f53397bc0 Items.cpp --- a/Items.cpp Sat Mar 08 22:23:20 2014 +0600 +++ b/Items.cpp Sat Mar 08 22:23:27 2014 +0600 @@ -452,7 +452,7 @@ { test_string = strtok(NULL, "\r") + 1; auto tokens = Tokenize(test_string, '\t'); - Assert(tokens.size() == 17, "Invalid number of tokens"); + Assert(tokens.size() >= 17, "Invalid number of tokens"); pSpecialEnchantments[i].pBonusStatement=RemoveQuotes(tokens[0]); pSpecialEnchantments[i].pNameAdd= RemoveQuotes(tokens[1]); for (int i = 0; i < 12; i++) @@ -507,9 +507,9 @@ pItems[item_counter].uDamageDice=atoi(tokens2[0]); pItems[item_counter].uDamageRoll=atoi(tokens2[1]); } - else if (tolower(test_string[0]) != 's') + else if (tolower(tokens2[0][0]) != 's') { - pItems[item_counter].uDamageDice=atoi(test_string); + pItems[item_counter].uDamageDice=atoi(tokens2[0]); pItems[item_counter].uDamageRoll=1; } else @@ -564,7 +564,6 @@ item_counter++; } - pRndItemsTXT_Raw = NULL; uAllItemsCount = item_counter; pRndItemsTXT_Raw = (char *)pEvents_LOD->LoadRaw("rnditems.txt", 0); @@ -646,7 +645,7 @@ { test_string = strtok(NULL, "\r") + 1; auto tokens = Tokenize(test_string, '\t'); - Assert(tokens.size() == 6, "Invalid number of tokens"); + Assert(tokens.size() >= 6, "Invalid number of tokens"); pSkillDesc[i] = RemoveQuotes(tokens[1]); pNormalSkillDesc[i] = RemoveQuotes(tokens[2]); pExpertSkillDesc[i] = RemoveQuotes(tokens[3]); diff -r 47b87aea14ba -r f38f53397bc0 texts.cpp --- a/texts.cpp Sat Mar 08 22:23:20 2014 +0600 +++ b/texts.cpp Sat Mar 08 22:23:27 2014 +0600 @@ -9,31 +9,16 @@ std::vector Tokenize( char* input, const char separator ) { std::vector retVect; - char* lastInput = input; + retVect.push_back(input); while (*input) { if (*input == separator) { - if (lastInput != nullptr) - { *input = '\0'; - retVect.push_back(lastInput); - lastInput = nullptr; - } - } - else - { - if (lastInput == nullptr) - { - lastInput = input; - } + retVect.push_back(input + 1); } ++input; } - if (lastInput != nullptr) - { - retVect.push_back(lastInput); - } return retVect; }