Skip to content

Commit

Permalink
fix stale reference (#1594)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmosewaMC authored May 24, 2024
1 parent f0960d4 commit 8ae1a8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dGame/dComponents/VendorComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ void VendorComponent::RefreshInventory(bool isCreation) {
if (vendorItems.empty()) break;
auto randomItemIndex = GeneralUtils::GenerateRandomNumber<int32_t>(0, vendorItems.size() - 1);
const auto& randomItem = vendorItems.at(randomItemIndex);
vendorItems.erase(vendorItems.begin() + randomItemIndex);
if (SetupItem(randomItem.itemid)) m_Inventory.push_back(SoldItem(randomItem.itemid, randomItem.sortPriority));
vendorItems.erase(vendorItems.begin() + randomItemIndex);
}
}
}
Expand Down

0 comments on commit 8ae1a8f

Please sign in to comment.