[Bug Fix] Fix issue where you can set your title to titles you don't have. (#1917)

* [Bug Fix] Fix issue where you can set your title to titles you don't have.

* Fixes.

* Fix missing logic check for HasTitle

Co-authored-by: Natedog2012 <jwalters_06@yahoo.com>
This commit is contained in:
Kinglykrab
2022-01-29 21:09:02 -05:00
committed by GitHub
parent 58d5983ef1
commit 7b235a6ede
3 changed files with 294 additions and 313 deletions
+8 -10
View File
@@ -12838,17 +12838,15 @@ void Client::Handle_OP_SetTitle(const EQApplicationPacket *app)
SetTitle_Struct *sts = (SetTitle_Struct *)app->pBuffer;
std::string Title;
if (!sts->is_suffix)
{
Title = title_manager.GetPrefix(sts->title_id);
SetAATitle(Title.c_str());
if (!title_manager.HasTitle(this, sts->title_id)) {
return;
}
else
{
Title = title_manager.GetSuffix(sts->title_id);
SetTitleSuffix(Title.c_str());
std::string title = !sts->is_suffix ? title_manager.GetPrefix(sts->title_id) : title_manager.GetSuffix(sts->title_id);
if (!sts->is_suffix) {
SetAATitle(title.c_str());
} else {
SetTitleSuffix(title.c_str());
}
}