From 70a07e154c3a1a6e2a45a0401139e2a11d7e0ff2 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Mon, 7 Jan 2019 06:04:09 +0600 Subject: [PATCH] Move receiver NULL check above the orresult check (#695) This is to prevent a VM abort from happening here if orresult is false. --- wadsrc/static/zscript/actor_inventory.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wadsrc/static/zscript/actor_inventory.txt b/wadsrc/static/zscript/actor_inventory.txt index 485194d9a..ec9b7d8d4 100644 --- a/wadsrc/static/zscript/actor_inventory.txt +++ b/wadsrc/static/zscript/actor_inventory.txt @@ -393,14 +393,14 @@ extend class Actor { int paramnum = 0; - if (!orresult) - { - receiver = receiver.GetPointer(setreceiver); - } if (receiver == NULL) { // If there's nothing to receive it, it's obviously a fail, right? return false; } + if (!orresult) + { + receiver = receiver.GetPointer(setreceiver); + } // Owned inventory items cannot own anything because their Inventory pointer is repurposed for the owner's linked list. if (receiver is 'Inventory' && Inventory(receiver).Owner != null) {