Fix loot crash

When applied this commit fixes a crash with the loot system due to a missing nullptr check.
This commit is contained in:
Wincent Holm 2021-12-22 17:16:31 +01:00 committed by GitHub
parent 65b7f49c9b
commit 271e14e2f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,6 +137,10 @@ std::unordered_map<LOT, int32_t> LootGenerator::RollLootMatrix(Entity* player, u
std::unordered_map<LOT, int32_t> drops; std::unordered_map<LOT, int32_t> drops;
if (missionComponent == nullptr) {
return drops;
}
const LootMatrix& matrix = m_LootMatrices[matrixIndex]; const LootMatrix& matrix = m_LootMatrices[matrixIndex];
for (const LootMatrixEntry& entry : matrix) { for (const LootMatrixEntry& entry : matrix) {