[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
+1 -1
View File
@@ -586,7 +586,7 @@ public:
virtual void SetName(const char *new_name = nullptr) { new_name ? strn0cpy(name, new_name, 64) :
strn0cpy(name, GetName(), 64); return; };
inline Mob* GetTarget() const { return target; }
std::string GetTargetDescription(Mob* target, uint8 description_type = TargetDescriptionType::LCSelf);
std::string GetTargetDescription(Mob* target, uint8 description_type = TargetDescriptionType::LCSelf, uint16 entity_id_override = 0);
virtual void SetTarget(Mob* mob);
inline bool HasTargetReflection() const { return (target && target != this && target->target == this); }
virtual inline float GetHPRatio() const { return max_hp == 0 ? 0 : ((float) current_hp / max_hp * 100); }