From 271e14e2f19177525b7d67f7cb9eed42ae5d5646 Mon Sep 17 00:00:00 2001 From: Wincent Holm Date: Wed, 22 Dec 2021 17:16:31 +0100 Subject: [PATCH] Fix loot crash When applied this commit fixes a crash with the loot system due to a missing nullptr check. --- dGame/dUtilities/Loot.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dGame/dUtilities/Loot.cpp b/dGame/dUtilities/Loot.cpp index 7e0f8323..4ec056a5 100644 --- a/dGame/dUtilities/Loot.cpp +++ b/dGame/dUtilities/Loot.cpp @@ -137,6 +137,10 @@ std::unordered_map LootGenerator::RollLootMatrix(Entity* player, u std::unordered_map drops; + if (missionComponent == nullptr) { + return drops; + } + const LootMatrix& matrix = m_LootMatrices[matrixIndex]; for (const LootMatrixEntry& entry : matrix) {