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);