aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2021-07-17 12:54:29 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-11 18:37:02 +0100
commit6fd7cd9dc9ca2f3ce2e90d719b292f0249972f93 (patch)
tree24c09446475ba423dde1d4035340e6d95cdc778f
parentc9e685bd9a0ac524edb8fe64eb6ec37540c55acc (diff)
Core/Pet: Don't allow to tame pets that have already a owner (#26674)
(cherry picked from commit 8c42b3bd88fe7bd3e959664312e818e25996873a)
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index b4a90172ce3..d7f0abd4295 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -531,6 +531,12 @@ class spell_hun_tame_beast : public SpellScript
if (!caster->GetCharmedGUID().IsEmpty())
return SPELL_FAILED_ALREADY_HAVE_CHARM;
+
+ if (!target->GetOwnerGUID().IsEmpty())
+ {
+ caster->SendTameFailure(PetTameResult::CreatureAlreadyOwned);
+ return SPELL_FAILED_DONT_REPORT;
+ }
}
else
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;