@@ -250,7 +250,7 @@ bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
250250 return true ;
251251}
252252
253- Creature::Creature (bool isWorldObject): Unit(isWorldObject), MapObject(), m_groupLootTimer(0 ), lootingGroupLowGUID( 0 ), m_PlayerDamageReq( 0 ), m_lootRecipient(), m_lootRecipientGroup (0 ), _pickpocketLootRestore(0 ),
253+ Creature::Creature (bool isWorldObject): Unit(isWorldObject), MapObject(), m_groupLootTimer(0 ), m_PlayerDamageReq(0 ), _pickpocketLootRestore(0 ),
254254 m_corpseRemoveTime(0 ), m_respawnTime(0 ), m_respawnDelay(300 ), m_corpseDelay(60 ), m_ignoreCorpseDecayRatio(false ), m_wanderDistance(0 .0f ),
255255 m_boundaryCheckTime(2500 ), m_combatPulseTime(0 ), m_combatPulseDelay(0 ), m_reactState(REACT_AGGRESSIVE),
256256 m_defaultMovementType(IDLE_MOTION_TYPE), m_spawnId(0 ), m_equipmentId(0 ), m_originalEquipmentId(0 ),
@@ -737,17 +737,18 @@ void Creature::Update(uint32 diff)
737737 if (IsEngaged ())
738738 Unit::AIUpdateTick (diff);
739739
740- if (m_groupLootTimer && lootingGroupLowGUID)
740+ if (m_groupLootTimer && ! lootingGroupLowGUID. IsEmpty () )
741741 {
742742 if (m_groupLootTimer <= diff)
743743 {
744- Group* group = sGroupMgr ->GetGroupByGUID (lootingGroupLowGUID);
745- if (group)
744+ if (Group* group = sGroupMgr ->GetGroupByGUID (lootingGroupLowGUID))
746745 group->EndRoll (&loot, GetMap ());
746+
747747 m_groupLootTimer = 0 ;
748- lootingGroupLowGUID = 0 ;
748+ lootingGroupLowGUID. Clear () ;
749749 }
750- else m_groupLootTimer -= diff;
750+ else
751+ m_groupLootTimer -= diff;
751752 }
752753 else if (m_corpseRemoveTime <= GameTime::GetGameTime ())
753754 {
@@ -1245,13 +1246,15 @@ Player* Creature::GetLootRecipient() const
12451246{
12461247 if (!m_lootRecipient)
12471248 return nullptr ;
1249+
12481250 return ObjectAccessor::FindConnectedPlayer (m_lootRecipient);
12491251}
12501252
12511253Group* Creature::GetLootRecipientGroup () const
12521254{
1253- if (! m_lootRecipientGroup)
1255+ if (m_lootRecipientGroup. IsEmpty () )
12541256 return nullptr ;
1257+
12551258 return sGroupMgr ->GetGroupByGUID (m_lootRecipientGroup);
12561259}
12571260
@@ -1264,7 +1267,7 @@ void Creature::SetLootRecipient(Unit* unit, bool withGroup)
12641267 if (!unit)
12651268 {
12661269 m_lootRecipient.Clear ();
1267- m_lootRecipientGroup = 0 ;
1270+ m_lootRecipientGroup. Clear () ;
12681271 RemoveDynamicFlag (UNIT_DYNFLAG_LOOTABLE|UNIT_DYNFLAG_TAPPED);
12691272 return ;
12701273 }
@@ -1280,10 +1283,10 @@ void Creature::SetLootRecipient(Unit* unit, bool withGroup)
12801283 if (withGroup)
12811284 {
12821285 if (Group* group = player->GetGroup ())
1283- m_lootRecipientGroup = group->GetLowGUID ();
1286+ m_lootRecipientGroup = group->GetGUID ();
12841287 }
12851288 else
1286- m_lootRecipientGroup = 0 ;
1289+ m_lootRecipientGroup = ObjectGuid::Empty ;
12871290
12881291 SetDynamicFlag (UNIT_DYNFLAG_TAPPED);
12891292}
0 commit comments