private bool ParentToPlayer(Item item, BaseEntity ourEntity) { HeldEntity heldEntity = ourEntity as HeldEntity; if (heldEntity == null) { return(false); } BasePlayer ownerPlayer = item.GetOwnerPlayer(); if (!ownerPlayer) { heldEntity.ClearOwnerPlayer(); return(true); } heldEntity.SetOwnerPlayer(ownerPlayer); return(true); }
private bool ParentToPlayer(Item item, BaseEntity ourEntity) { HeldEntity heldEntity = ourEntity as HeldEntity; if (Object.op_Equality((Object)heldEntity, (Object)null)) { return(false); } BasePlayer ownerPlayer = item.GetOwnerPlayer(); if (Object.op_Implicit((Object)ownerPlayer)) { heldEntity.SetOwnerPlayer(ownerPlayer); return(true); } heldEntity.ClearOwnerPlayer(); return(true); }