示例#1
0
    public static bool DestroyBag(BasePlayer player, uint sleepingBag)
    {
        SleepingBag forPlayer = SleepingBag.FindForPlayer(player.userID, sleepingBag, false);

        if (Object.op_Equality((Object)forPlayer, (Object)null))
        {
            return(false);
        }
        if (forPlayer.canBePublic)
        {
            forPlayer.SetPublic(true);
            forPlayer.deployerUserID = 0UL;
        }
        else
        {
            forPlayer.Kill(BaseNetworkable.DestroyMode.None);
        }
        player.SendRespawnOptions();
        return(true);
    }
示例#2
0
    public static bool DestroyBag(BasePlayer player, uint sleepingBag)
    {
        SleepingBag sleepingBag1 = SleepingBag.FindForPlayer(player.userID, sleepingBag, false);

        if (sleepingBag1 == null)
        {
            return(false);
        }
        if (!sleepingBag1.canBePublic)
        {
            sleepingBag1.Kill(BaseNetworkable.DestroyMode.None);
        }
        else
        {
            sleepingBag1.SetPublic(true);
            sleepingBag1.deployerUserID = (ulong)0;
        }
        player.SendRespawnOptions();
        return(true);
    }