Exemplo n.º 1
0
    public virtual void SetupCorpse(BaseCorpse corpse)
    {
        corpse.flags = flags;
        LootableCorpse component = corpse.GetComponent <LootableCorpse>();

        if ((bool)component)
        {
            component.TakeFrom(inventory);
        }
    }
Exemplo n.º 2
0
        private void DropBodyOfPlayer(BasePlayer player)
        {
            BaseCorpse corpse = player.DropCorpse("assets/prefabs/player/player_corpse.prefab");

            if (corpse != null)
            {
                LootableCorpse lootable = corpse as LootableCorpse;
                if (lootable != null)
                {
                    ItemContainer[] source = new ItemContainer[] { player.inventory?.containerMain, player.inventory?.containerWear, player.inventory?.containerBelt };
                    lootable.TakeFrom(source);
                    lootable.playerName    = player.displayName;
                    lootable.playerSteamID = player.userID;
                }
                corpse.SpawnAsMapEntity();
            }
        }