diff --git a/CHANGELOG.md b/CHANGELOG.md index eef257304..effa4137e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [22.56.1] 9/13/2024 + +### Fixes + +* Fix Untrained Disciplines in Client::SaveDisciplines() ([#4472](https://github.com/EQEmu/Server/pull/4472)) @Kinglykrab 2024-09-13 +* Fix Infinite Loop in Adventure::Finished() ([#4473](https://github.com/EQEmu/Server/pull/4473)) @oddx2k 2024-09-13 + ## [22.56.0] 9/12/2024 ### Code diff --git a/common/version.h b/common/version.h index bc6da525b..a25a53acb 100644 --- a/common/version.h +++ b/common/version.h @@ -25,7 +25,7 @@ // Build variables // these get injected during the build pipeline -#define CURRENT_VERSION "22.56.0-dev" // always append -dev to the current version for custom-builds +#define CURRENT_VERSION "22.56.1-dev" // always append -dev to the current version for custom-builds #define LOGIN_VERSION "0.8.0" #define COMPILE_DATE __DATE__ #define COMPILE_TIME __TIME__ diff --git a/package.json b/package.json index 35fb54730..1f8fe74fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eqemu-server", - "version": "22.56.0", + "version": "22.56.1", "repository": { "type": "git", "url": "https://github.com/EQEmu/Server.git" diff --git a/zone/client.cpp b/zone/client.cpp index aca80c8b7..bc734dea6 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -11097,7 +11097,9 @@ void Client::SaveDisciplines() { std::vector v; - for (int slot_id = 0; slot_id < MAX_PP_DISCIPLINES; slot_id++) { + std::vector delete_slots; + + for (uint16 slot_id = 0; slot_id < MAX_PP_DISCIPLINES; slot_id++) { if (IsValidSpell(m_pp.disciplines.values[slot_id])) { auto e = CharacterDisciplinesRepository::NewEntity(); @@ -11106,9 +11108,21 @@ void Client::SaveDisciplines() e.disc_id = m_pp.disciplines.values[slot_id]; v.emplace_back(e); + } else { + delete_slots.emplace_back(std::to_string(slot_id)); } } + if (!delete_slots.empty()) { + CharacterDisciplinesRepository::DeleteWhere( + database, + fmt::format( + "`slot_id` IN ({})", + Strings::Join(delete_slots, ", ") + ) + ); + } + if (!v.empty()) { CharacterDisciplinesRepository::ReplaceMany(database, v); }