mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[Bug Fix] Fix Client::RemoveTitle (#4421)
* [Bug Fix] Fix Client::RemoveTitle * Remove title/suffix if in use. * Update titles.cpp * Non static
This commit is contained in:
+16
-2
@@ -19,7 +19,7 @@
|
||||
#include "../common/eq_packet_structs.h"
|
||||
#include "../common/strings.h"
|
||||
#include "../common/misc_functions.h"
|
||||
#include "../common/repositories/titles_repository.h"
|
||||
#include "../common/repositories/player_titlesets_repository.h"
|
||||
|
||||
#include "client.h"
|
||||
#include "entity.h"
|
||||
@@ -343,7 +343,21 @@ void Client::RemoveTitle(int title_set)
|
||||
return;
|
||||
}
|
||||
|
||||
TitlesRepository::DeleteWhere(
|
||||
for (const auto& title : title_manager.GetTitles()) {
|
||||
if (title.titleset == title_set) {
|
||||
if (std::string(m_pp.title) == title.prefix) {
|
||||
SetAATitle("");
|
||||
}
|
||||
|
||||
if (std::string(m_pp.suffix) == title.suffix) {
|
||||
SetTitleSuffix("");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PlayerTitlesetsRepository::DeleteWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"`title_set` = {} AND `char_id` = {}",
|
||||
|
||||
Reference in New Issue
Block a user