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
|
#ifdef ENABLE_PLAYERBOTS
|
||||||
ObjectGuid GetTargetIcon(int index) { return m_targetIcons[index]; }
|
ObjectGuid GetTargetIcon(int index) { return m_targetIcons[index]; }
|
||||||
Rolls GetRolls() { return RollId; }
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -23,15 +23,10 @@ bool LootRollAction::Execute(Event event)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
RollVote vote = ROLL_PASS;
|
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;
|
|
||||||
|
|
||||||
|
ItemPrototype const *proto = sItemStorage.LookupEntry<ItemPrototype>(guid.GetEntry());
|
||||||
|
if(proto)
|
||||||
|
{
|
||||||
switch (proto->Class)
|
switch (proto->Class)
|
||||||
{
|
{
|
||||||
case ITEM_CLASS_WEAPON:
|
case ITEM_CLASS_WEAPON:
|
||||||
@ -40,12 +35,10 @@ bool LootRollAction::Execute(Event event)
|
|||||||
vote = ROLL_NEED;
|
vote = ROLL_NEED;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (IsLootAllowed(itemId))
|
if (IsLootAllowed(guid.GetEntry()))
|
||||||
vote = ROLL_NEED;
|
vote = ROLL_NEED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (group->GetLootMethod())
|
switch (group->GetLootMethod())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user