Fix integer issue with BricksCollected (#679)

This fixes an issue where BricksCollected goes to an insane number after selling more bricks than you collected in the area
This commit is contained in:
eddytronpie 2022-07-30 04:41:14 +01:00 committed by GitHub
parent 26ddeaa429
commit f80a26a944
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -211,7 +211,7 @@ void CharacterComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
ZoneStatistics statistics = {};
child->QueryUnsigned64Attribute("ac", &statistics.m_AchievementsCollected);
child->QueryUnsigned64Attribute("bc", &statistics.m_BricksCollected);
child->QueryInt64Attribute("bc", &statistics.m_BricksCollected);
child->QueryUnsigned64Attribute("cc", &statistics.m_CoinsCollected);
child->QueryUnsigned64Attribute("es", &statistics.m_EnemiesSmashed);
child->QueryUnsigned64Attribute("qbc", &statistics.m_QuickBuildsCompleted);
@ -226,6 +226,7 @@ void CharacterComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
}
const tinyxml2::XMLAttribute* rocketConfig = character->FindAttribute("lcbp");
if (rocketConfig) {
m_LastRocketConfig = GeneralUtils::ASCIIToUTF16(std::string(rocketConfig->Value()));
} else {

View File

@ -15,7 +15,7 @@
*/
struct ZoneStatistics {
uint64_t m_AchievementsCollected;
uint64_t m_BricksCollected;
int64_t m_BricksCollected;
uint64_t m_CoinsCollected;
uint64_t m_EnemiesSmashed;
uint64_t m_QuickBuildsCompleted;
@ -431,7 +431,7 @@ private:
/**
* The total amount of bricks collected by this character
*/
uint64_t m_BricksCollected;
int64_t m_BricksCollected;
/**
* The total amount of entities smashed by this character