aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-09-01 20:07:58 +0200
committerShauren <shauren.trinity@gmail.com>2022-09-01 20:07:58 +0200
commit7957e2d380e08fa831765f610c0e29d2f3e11a04 (patch)
tree55632f7f94edb3096360c983abbdd448d8dc79d7 /src/server/game/Spells/Spell.cpp
parent62e5b52d2b91832889f02edc7bbd83ad474923e3 (diff)
Core/Loot: Allocate Loot separately from objects
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index d461c4298f7..f49f0495339 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -37,6 +37,7 @@
#include "InstanceScript.h"
#include "Item.h"
#include "Log.h"
+#include "Loot.h"
#include "LootMgr.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
@@ -5996,7 +5997,8 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
return SPELL_FAILED_TARGET_UNSKINNABLE;
Creature* creature = m_targets.GetUnitTarget()->ToCreature();
- if (!creature->IsCritter() && !creature->loot.isLooted())
+ Loot* loot = creature->GetLootForPlayer(m_caster->ToPlayer());
+ if (loot && !loot->isLooted())
return SPELL_FAILED_TARGET_NOT_LOOTED;
uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill();