Move receiver NULL check above the orresult check (#695)

This is to prevent a VM abort from happening here if orresult is false.
This commit is contained in:
Cacodemon345 2019-01-07 06:04:09 +06:00 committed by Christoph Oelckers
parent 7666997580
commit 70a07e154c

View file

@ -393,14 +393,14 @@ extend class Actor
{ {
int paramnum = 0; int paramnum = 0;
if (!orresult)
{
receiver = receiver.GetPointer(setreceiver);
}
if (receiver == NULL) if (receiver == NULL)
{ // If there's nothing to receive it, it's obviously a fail, right? { // If there's nothing to receive it, it's obviously a fail, right?
return false; 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. // 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) if (receiver is 'Inventory' && Inventory(receiver).Owner != null)
{ {