fix(Scripts/SSC): Fix being able to damage Leo's minions if you are n… (#17786)

* fix(Scripts/SSC): Fix being able to damage Leo's minions if you are not the target player

* implement helper

* Update Creature.cpp

* Update Creature.h
This commit is contained in:
Andrew
2023-11-19 08:38:47 -03:00
committed by GitHub
parent 4bf20ffde4
commit bf40479db6
3 changed files with 40 additions and 13 deletions

View File

@@ -3736,6 +3736,15 @@ bool Creature::CanCastSpell(uint32 spellID) const
return true;
}
ObjectGuid Creature::GetSummonerGUID() const
{
if (TempSummon const* temp = ToTempSummon())
return temp->GetSummonerGUID();
LOG_DEBUG("entities.unit", "Creature::GetSummonerGUID() called by creature that is not a summon. Creature: {} ({})", GetEntry(), GetName());
return ObjectGuid::Empty;
}
std::string Creature::GetDebugInfo() const
{
std::stringstream sstr;

View File

@@ -407,6 +407,12 @@ public:
* */
bool CanCastSpell(uint32 spellID) const;
/**
* @brief Helper to get the creature's summoner GUID, if it is a summon
*
* */
[[nodiscard]] ObjectGuid GetSummonerGUID() const;
std::string GetDebugInfo() const override;
protected: