Fix for null ref exception after refinery is sold.

This commit is contained in:
James Dunne
2012-06-29 22:55:45 -05:00
parent 643154de15
commit 3754e791e5

View File

@@ -148,7 +148,7 @@ namespace OpenRA.Mods.RA
{
// Check that we're not in a critical location and being useless (refinery drop-off):
var lastproc = LastLinkedProc ?? LinkedProc;
if (lastproc != null)
if (lastproc != null && !lastproc.Destroyed)
{
var deliveryLoc = lastproc.Location + lastproc.Trait<IAcceptOre>().DeliverOffset;
if (self.Location == deliveryLoc)