Core/Quests: Change Player::KilledMonster arguments to take Creature directly

This commit is contained in:
Shauren
2024-12-02 15:24:36 +01:00
parent 5df1c6dea6
commit 49699bc966
3 changed files with 7 additions and 6 deletions

View File

@@ -183,7 +183,7 @@ inline void KillRewarder::_RewardKillCredit(Player* player)
{
if (Creature* target = _victim->ToCreature())
{
player->KilledMonster(target->GetCreatureTemplate(), target->GetGUID());
player->KilledMonster(target);
player->UpdateCriteria(CriteriaType::KillAnyCreature, target->GetCreatureType(), 1, 0, target);
}
}

View File

@@ -16655,12 +16655,13 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 /*count*/)
UpdateVisibleObjectInteractions(true, false, false, true);
}
void Player::KilledMonster(CreatureTemplate const* cInfo, ObjectGuid guid)
void Player::KilledMonster(Creature const* creature)
{
ASSERT(cInfo);
ASSERT(creature);
if (cInfo->Entry)
KilledMonsterCredit(cInfo->Entry, guid);
CreatureTemplate const* cInfo = creature->GetCreatureTemplate();
KilledMonsterCredit(cInfo->Entry, creature->GetGUID());
for (uint8 i = 0; i < MAX_KILL_CREDIT; ++i)
if (cInfo->KillCredit[i])

View File

@@ -1715,7 +1715,7 @@ class TC_GAME_API Player final : public Unit, public GridObject<Player>
void GroupEventHappens(uint32 questId, WorldObject const* pEventObject);
void ItemAddedQuestCheck(uint32 entry, uint32 count, Optional<bool> boundItemFlagRequirement = {}, bool* hadBoundItemObjective = nullptr);
void ItemRemovedQuestCheck(uint32 entry, uint32 count);
void KilledMonster(CreatureTemplate const* cInfo, ObjectGuid guid);
void KilledMonster(Creature const* creature);
void KilledMonsterCredit(uint32 entry, ObjectGuid guid = ObjectGuid::Empty);
void KilledPlayerCredit(ObjectGuid victimGuid);
void KillCreditGO(uint32 entry, ObjectGuid guid = ObjectGuid::Empty);