[Bug Fix] Using %T in channel messages on fresh corpse yields mob, not corpse name. (#4168)

* [Bug Fix] Using %T in channel messages on fresh corpse yields mob/player name, not corpse name.

* Undo changes to PC corpse.

* Use rename to fix %T usage on client for those in zone

* Fix indentation spacing

* Update to consolidate Rename as suggested.

* Fix for mobs with ` in name

* Fix to use GetName() instead of GetCleanName()
This commit is contained in:
Paul Coene
2024-04-05 09:29:48 -04:00
committed by GitHub
parent 043eeced6f
commit b1d873d1fc
3 changed files with 27 additions and 10 deletions
+9 -1
View File
@@ -2500,8 +2500,9 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
d->spell_id = UINT32_MAX;
d->attack_skill = SkillDamageTypes[attack_skill];
d->damage = damage;
d->corpseid = GetID();
app->priority = 6;
app->priority = 1;
entity_list.QueueClients(killer_mob, app, false);
@@ -2833,8 +2834,15 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
}
entity_list.LimitRemoveNPC(this);
entity_list.AddCorpse(corpse, GetID());
// The client sees NPC corpses as name's_corpse. The server uses
// name`s_corpse so that %T works on corpses (client workaround)
// Rename the new corpse on client side.
std::string old_name = Strings::Replace(corpse->GetName(), "`s_corpse", "'s_corpse");
SendRename(killer_mob, old_name.c_str(), corpse->GetName());
entity_list.UnMarkNPC(GetID());
entity_list.RemoveNPC(GetID());