mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-21 18:40:03 +00:00
find a dream lantern that's not being held by anyone
This commit is contained in:
parent
cac9e840db
commit
b43eaf8ee5
@ -1,8 +1,10 @@
|
|||||||
using QSB.Messaging;
|
using QSB.ItemSync.WorldObjects.Items;
|
||||||
|
using QSB.Messaging;
|
||||||
using QSB.Player;
|
using QSB.Player;
|
||||||
using QSB.RespawnSync;
|
using QSB.RespawnSync;
|
||||||
using QSB.ShipSync;
|
using QSB.ShipSync;
|
||||||
using QSB.Utility.Messages;
|
using QSB.Utility.Messages;
|
||||||
|
using QSB.WorldSync;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.InputSystem;
|
using UnityEngine.InputSystem;
|
||||||
@ -73,7 +75,10 @@ public class DebugActions : MonoBehaviour, IAddComponentOnStart
|
|||||||
var dreamCampfire = Locator.GetDreamCampfire(location);
|
var dreamCampfire = Locator.GetDreamCampfire(location);
|
||||||
if (Locator.GetToolModeSwapper().GetItemCarryTool().GetHeldItemType() != ItemType.DreamLantern)
|
if (Locator.GetToolModeSwapper().GetItemCarryTool().GetHeldItemType() != ItemType.DreamLantern)
|
||||||
{
|
{
|
||||||
var dreamLanternItem = FindObjectsOfType<DreamLanternItem>().First(x => x._lanternType == DreamLanternType.Functioning);
|
var dreamLanternItem = QSBWorldSync.GetWorldObjects<QSBDreamLanternItem>().First(x =>
|
||||||
|
x.AttachedObject._lanternType == DreamLanternType.Functioning &&
|
||||||
|
QSBPlayerManager.PlayerList.All(y => y.HeldItem != x)
|
||||||
|
).AttachedObject;
|
||||||
Locator.GetToolModeSwapper().GetItemCarryTool().PickUpItemInstantly(dreamLanternItem);
|
Locator.GetToolModeSwapper().GetItemCarryTool().PickUpItemInstantly(dreamLanternItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user