Core/Misc: Fix a few coverity issues

CID 1360566
CID 1360567
CID 1361723
This commit is contained in:
Shauren
2017-01-25 17:40:08 +01:00
parent 6c57ab2b4f
commit d9418ae00a
3 changed files with 3 additions and 3 deletions

View File

@@ -333,7 +333,7 @@ bool Item::Create(ObjectGuid::LowType guidlow, uint32 itemid, Player const* owne
continue;
if (PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(artifactAppearance->PlayerConditionID))
if (!sConditionMgr->IsPlayerMeetingCondition(owner, playerCondition))
if (!owner || !sConditionMgr->IsPlayerMeetingCondition(owner, playerCondition))
continue;
SetModifier(ITEM_MODIFIER_ARTIFACT_APPEARANCE_ID, artifactAppearance->ID);

View File

@@ -975,7 +975,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* lootedObject)
if (i->freeforall)
continue;
item = sObjectMgr->GetItemTemplate(i->itemid);
item = ASSERT_NOTNULL(sObjectMgr->GetItemTemplate(i->itemid));
//roll for over-threshold item if it's one-player loot
if (item->GetQuality() >= uint32(m_lootThreshold))

View File

@@ -229,7 +229,7 @@ uint32 Quest::XPValue(uint32 playerLevel) const
{
uint32 questLevel = uint32(Level == -1 ? playerLevel : Level);
QuestXPEntry const* questXp = sQuestXPStore.LookupEntry(questLevel);
if (!questXp || RewardXPDifficulty > 10)
if (!questXp || RewardXPDifficulty >= 10)
return 0;
float multiplier = 1.0f;