mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +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:
parent
23308192b5
commit
e5cea73e0c
@ -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` = {}",
|
||||
|
||||
@ -57,6 +57,7 @@ public:
|
||||
void CreateNewPlayerTitle(Client *client, std::string title);
|
||||
void CreateNewPlayerSuffix(Client *client, std::string suffix);
|
||||
bool HasTitle(Client* client, uint32 title_id);
|
||||
inline const std::vector<TitleEntry>& GetTitles() { return titles; }
|
||||
|
||||
protected:
|
||||
std::vector<TitleEntry> titles;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user