[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
2023-09-17 14:40:31 -04:00
committed by GitHub
parent 9b992167f0
commit d7e810232a
3 changed files with 44 additions and 50 deletions
+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()
)
)
);