[Bug Fix] Fix entity ID on death with #castspell (#3592)

# Notes
- Entities killed by a spell with #cast were not reporting their pre-death entity ID properly.
- Added an `entity_id_override` to `GetTargetDescription()` and added a pre-defined entity ID variable to the cast command so we can message the proper pre-death entity ID.
This commit is contained in:
Alex King authored and GitHub committed 2023-09-17 13:40:31 -05:00
1 parent 9b992167f0
commit d7e810232a
3 files changed
+44 -50

No files matched your search

+2 -2
View File
@@ -5068,7 +5068,7 @@ const char *Mob::GetCleanName()
return clean_name;
}
std::string Mob::GetTargetDescription(Mob* target, uint8 description_type)
std::string Mob::GetTargetDescription(Mob* target, uint8 description_type, uint16 entity_id_override)
{
std::string self_return = "yourself";
@@ -5119,7 +5119,7 @@ std::string Mob::GetTargetDescription(Mob* target, uint8 description_type)
fmt::format(
"{} ({})",
target->GetCleanName(),
target->GetID()
entity_id_override ? entity_id_override : target->GetID()
)
)
);