[Bug Fix] Clear title/suffix bug fix. (#2068)

- Clearing uses title ID 0, so need to make sure title ID is valid when setting and based on that, either check and set, or just clear.
This commit is contained in:
Kinglykrab authored and GitHub committed 2022-04-02 11:09:48 -04:00
1 parent bbe2db7c0f
commit 5d94c9844a
1 file changed
+11 -2
+11 -2
View File
@@ -12877,11 +12877,20 @@ void Client::Handle_OP_SetTitle(const EQApplicationPacket *app)
SetTitle_Struct *sts = (SetTitle_Struct *)app->pBuffer;
if (!title_manager.HasTitle(this, sts->title_id)) {
if (sts->title_id && !title_manager.HasTitle(this, sts->title_id)) {
return;
}
std::string title = !sts->is_suffix ? title_manager.GetPrefix(sts->title_id) : title_manager.GetSuffix(sts->title_id);
std::string title = (
sts->title_id ?
(
!sts->is_suffix ?
title_manager.GetPrefix(sts->title_id) :
title_manager.GetSuffix(sts->title_id)
) :
""
);
if (!sts->is_suffix) {
SetAATitle(title.c_str());
} else {