Core/Player: Prevent a crash in CastedCreatureOrGO and add an assertion to KilledMonster
This commit is contained in:
@@ -256,7 +256,7 @@ void PetAI::UpdateAI(const uint32 diff)
|
||||
me->UpdateSpeed(MOVE_RUN, true);
|
||||
me->UpdateSpeed(MOVE_WALK, true);
|
||||
me->UpdateSpeed(MOVE_FLIGHT, true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void PetAI::UpdateAllies()
|
||||
|
||||
@@ -16007,6 +16007,8 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count)
|
||||
|
||||
void Player::KilledMonster(CreatureTemplate const* cInfo, uint64 guid)
|
||||
{
|
||||
ASSERT(cInfo);
|
||||
|
||||
if (cInfo->Entry)
|
||||
KilledMonsterCredit(cInfo->Entry, guid);
|
||||
|
||||
@@ -16159,6 +16161,12 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id)
|
||||
if (reqTarget != entry) // if entry doesn't match, check for killcredits referenced in template
|
||||
{
|
||||
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
|
||||
if (!cinfo)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_PLAYER, "Player::CastedCreatureOrGO: GetCreatureTemplate failed for entry %u. Skipping.", entry);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (uint8 k = 0; k < MAX_KILL_CREDIT; ++k)
|
||||
if (cinfo->KillCredit[k] == reqTarget)
|
||||
entry = cinfo->KillCredit[k];
|
||||
|
||||
@@ -12722,7 +12722,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
|
||||
// to help prevent pet from lagging behind and despawning
|
||||
float dist = GetDistance(pOwner);
|
||||
float base_rate = 1.00f; // base speed is 100% of owner speed
|
||||
|
||||
|
||||
if (dist < 5)
|
||||
dist = 5;
|
||||
|
||||
|
||||
@@ -1033,7 +1033,7 @@ public:
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!found)
|
||||
handler->SendSysMessage(LANG_COMMAND_NOSPELLFOUND);
|
||||
|
||||
|
||||
@@ -153,13 +153,13 @@ enum Texts
|
||||
SAY_KILLED_PLAYER_P_THREE = 12,
|
||||
SAY_SPELL_CASTING_P_THREE = 13,
|
||||
SAY_DEATH,
|
||||
|
||||
|
||||
// Alexstrasza
|
||||
SAY_ONE = 0,
|
||||
SAY_TWO = 1,
|
||||
SAY_THREE = 2,
|
||||
SAY_FOUR = 3,
|
||||
|
||||
|
||||
// Power Sparks
|
||||
EMOTE_POWER_SPARK_SUMMONED = 0
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user