public virtual void SetupCorpse(BaseCorpse corpse) { corpse.flags = flags; LootableCorpse component = corpse.GetComponent <LootableCorpse>(); if ((bool)component) { component.TakeFrom(inventory); } }
private void OnPlayerCorpseSpawned(BasePlayer player, BaseCorpse corpse) { if (!_lastDroppedBackpacks.ContainsKey(player.userID)) { return; } var container = _lastDroppedBackpacks[player.userID]; if (container == null) { return; } var corpseCollider = corpse.GetComponent <Collider>(); var containerCollider = _lastDroppedBackpacks[player.userID].GetComponent <Collider>(); if (corpseCollider != null && containerCollider != null) { Physics.IgnoreCollision(corpseCollider, containerCollider); } _lastDroppedBackpacks.Remove(player.userID); }