fix(Core/Common): Container fixes use after free (#21460)

This commit is contained in:
Jelle Meeus
2025-02-15 22:22:30 +01:00
committed by GitHub
parent 75752880e2
commit a05833eeed
4 changed files with 29 additions and 9 deletions

View File

@@ -205,10 +205,12 @@ public:
{
if (_availableRiftPositions.size() > 1)
{
spawnPos = Acore::Containers::SelectRandomContainerElementIf(_availableRiftPositions, [&](Position pos) -> bool
auto spawnPosItr = Acore::Containers::SelectRandomContainerElementIf(_availableRiftPositions, [&](Position const& pos) -> bool
{
return pos != lastPosition;
});
if (spawnPosItr != _availableRiftPositions.end())
spawnPos = *spawnPosItr;
}
else
{