Merge pull request #76 from ValeTheVioletMote/ValeTheVioletMote-rolling-fix
Segmentation Fault on Bot Loot Rolling - Fix
This commit is contained in:
commit
03e2f85820
@ -463,7 +463,6 @@ class Group
|
||||
|
||||
#ifdef ENABLE_PLAYERBOTS
|
||||
ObjectGuid GetTargetIcon(int index) { return m_targetIcons[index]; }
|
||||
Rolls GetRolls() { return RollId; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
@ -23,27 +23,20 @@ bool LootRollAction::Execute(Event event)
|
||||
return false;
|
||||
|
||||
RollVote vote = ROLL_PASS;
|
||||
for (vector<Roll*>::iterator i = group->GetRolls().begin(); i != group->GetRolls().end(); ++i)
|
||||
{
|
||||
if ((*i)->isValid() && (*i)->lootedTargetGUID == guid && (*i)->itemSlot == slot)
|
||||
{
|
||||
uint32 itemId = (*i)->itemid;
|
||||
ItemPrototype const *proto = sItemStorage.LookupEntry<ItemPrototype>(itemId);
|
||||
if (!proto)
|
||||
continue;
|
||||
|
||||
switch (proto->Class)
|
||||
{
|
||||
case ITEM_CLASS_WEAPON:
|
||||
case ITEM_CLASS_ARMOR:
|
||||
if (QueryItemUsage(proto))
|
||||
vote = ROLL_NEED;
|
||||
break;
|
||||
default:
|
||||
if (IsLootAllowed(itemId))
|
||||
vote = ROLL_NEED;
|
||||
break;
|
||||
}
|
||||
ItemPrototype const *proto = sItemStorage.LookupEntry<ItemPrototype>(guid.GetEntry());
|
||||
if(proto)
|
||||
{
|
||||
switch (proto->Class)
|
||||
{
|
||||
case ITEM_CLASS_WEAPON:
|
||||
case ITEM_CLASS_ARMOR:
|
||||
if (QueryItemUsage(proto))
|
||||
vote = ROLL_NEED;
|
||||
break;
|
||||
default:
|
||||
if (IsLootAllowed(guid.GetEntry()))
|
||||
vote = ROLL_NEED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user