Skip to content

Commit 397b623

Browse files
authored
Fix playerbot crash when rolling for loot (#112)
1 parent 5725076 commit 397b623

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/modules/Bots/playerbot/strategy/actions/LootRollAction.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ bool LootRollAction::Execute(Event event)
4747
}
4848
}
4949
#else
50-
for (vector<Roll*>::iterator i = group->GetRolls().begin(); i != group->GetRolls().end(); ++i)
50+
for (auto& roll : group->GetRolls())
5151
{
52-
if ((*i)->isValid() && (*i)->lootedTargetGUID == guid && (*i)->itemSlot == slot)
52+
if (roll->isValid() && roll->lootedTargetGUID == guid && roll->itemSlot == slot)
5353
{
54-
uint32 itemId = (*i)->itemid;
54+
uint32 itemId = roll->itemid;
5555
ItemPrototype const *proto = sItemStorage.LookupEntry<ItemPrototype>(itemId);
5656
if (!proto)
5757
{

0 commit comments

Comments
 (0)