From 75249523a45fbfa3715aefbaec448373802c8c82 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Wed, 6 Apr 2022 16:04:37 -0700 Subject: [PATCH] DropItemMessage: sector can be null --- QSB/ItemSync/Messages/DropItemMessage.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QSB/ItemSync/Messages/DropItemMessage.cs b/QSB/ItemSync/Messages/DropItemMessage.cs index ba84b944..5577f18f 100644 --- a/QSB/ItemSync/Messages/DropItemMessage.cs +++ b/QSB/ItemSync/Messages/DropItemMessage.cs @@ -35,7 +35,7 @@ internal class DropItemMessage : QSBWorldObjectMessage().ObjectId; } - tuple.sectorId = sector.GetWorldObject().ObjectId; + tuple.sectorId = sector ? sector.GetWorldObject().ObjectId : -1; tuple.localPosition = parent.InverseTransformPoint(worldPosition); tuple.localNormal = parent.InverseTransformDirection(worldNormal); @@ -55,7 +55,7 @@ internal class DropItemMessage : QSBWorldObjectMessage().AttachedObject; + var sector = Data.sectorId != -1 ? Data.sectorId.GetWorldObject().AttachedObject : null; WorldObject.DropItem(worldPos, worldNormal, parent, sector, customDropTarget);