diff --git a/Adventures in Lestoria/Item.cpp b/Adventures in Lestoria/Item.cpp index 27da8b4c..815770c6 100644 --- a/Adventures in Lestoria/Item.cpp +++ b/Adventures in Lestoria/Item.cpp @@ -490,6 +490,9 @@ std::vector>Inventory::GetItem(IT it){ uint32_t Inventory::GetItemCount(IT it){ if(!_inventory.count(it)){ return 0; + }else + if(ITEM_DATA.at(it).IsAccessory()){ + return 1; //We always only have 1 of any given accessory. }else{ auto inventory=_inventory.equal_range(it); return std::accumulate(inventory.first,inventory.second,0,[](int val,std::pair>it){return val+(*it.second).Amt();}); diff --git a/Adventures in Lestoria/SaveFile.cpp b/Adventures in Lestoria/SaveFile.cpp index bb69dbd9..b1981d0f 100644 --- a/Adventures in Lestoria/SaveFile.cpp +++ b/Adventures in Lestoria/SaveFile.cpp @@ -304,10 +304,18 @@ void SaveFile::LoadFile(){ std::string expectedFileHash=loadFile["Hash"].GetString(); loadFile["Hash"].SetString(""); utils::datafile::Write(loadFile,"save_file_path"_S+std::format("save.{:04}",saveFileID)); + + auto trim = [](std::string& s) + { + s.erase(0, s.find_first_not_of(" \t\n\r\f\v")); + s.erase(s.find_last_not_of(" \t\n\r\f\v") + 1); + }; + std::string fileHash=util::GetHash("save_file_path"_S+std::format("save.{:04}",saveFileID)); + trim(fileHash); //It's possible the expected file hash has a space at the end/beginning that gets stripped out. We want to trim and match that string. if(expectedFileHash!=fileHash){ - LOG(std::format("WARNING! Filehash for file {} was not identified as proper! Will not load this file!","save_file_path"_S+std::format("save.{:04}",saveFileID))); + ERR(std::format("WARNING! Filehash for file {} was not identified as proper! Will not load this file!","save_file_path"_S+std::format("save.{:04}",saveFileID))); return; } diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index eadfbb68..51c89c80 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 0 #define VERSION_PATCH 0 -#define VERSION_BUILD 8630 +#define VERSION_BUILD 8647 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 286d4dc9..2cc39696 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ