mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-30 08:47:58 +03:00
Fix possible nullref exception
This commit is contained in:
parent
335d29ec61
commit
258970a406
1 changed files with 2 additions and 2 deletions
|
@ -331,9 +331,9 @@ void PuzzleDoneCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* co
|
|||
void PuzzleDone(ItemInfo* item, short itemNumber)
|
||||
{
|
||||
auto triggerIndex = GetTriggerIndex(item);
|
||||
short triggerType = (*(triggerIndex++) >> 8) & TRIGGER_BITS;
|
||||
short triggerType = (triggerIndex != nullptr) ? (*(triggerIndex++) >> 8) & TRIGGER_BITS : TRIGGER_TYPES::TRIGGER;
|
||||
|
||||
if (triggerIndex != nullptr && triggerType == TRIGGER_TYPES::SWITCH)
|
||||
if (triggerType == TRIGGER_TYPES::SWITCH)
|
||||
{
|
||||
item->ItemFlags[1] = true;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue