diff --git a/Fika.Core/Coop/GameMode/CoopGame.cs b/Fika.Core/Coop/GameMode/CoopGame.cs index 86226100..34ae20bc 100644 --- a/Fika.Core/Coop/GameMode/CoopGame.cs +++ b/Fika.Core/Coop/GameMode/CoopGame.cs @@ -773,6 +773,7 @@ public override async Task vmethod_2(int playerId, Vector3 position } CoopPlayer coopPlayer = (CoopPlayer)myPlayer; + coopPlayer.SetupMainPlayer(); coopHandler.Players.Add(coopPlayer.NetId, coopPlayer); PlayerSpawnRequest body = new(myPlayer.ProfileId, FikaBackendUtils.GetGroupId()); diff --git a/Fika.Core/Coop/Players/CoopPlayer.cs b/Fika.Core/Coop/Players/CoopPlayer.cs index c1a404e1..92d8e45b 100644 --- a/Fika.Core/Coop/Players/CoopPlayer.cs +++ b/Fika.Core/Coop/Players/CoopPlayer.cs @@ -871,10 +871,12 @@ public override void TryInteractionCallback(LootableContainer container) _openAction = null; } - protected virtual void Start() + public void SetupMainPlayer() { + // Set own group id Profile.Info.GroupId = "Fika"; + // Setup own dog tag if (Side != EPlayerSide.Savage) { if (Equipment.GetSlot(EquipmentSlot.Dogtag).ContainedItem != null) @@ -882,7 +884,7 @@ protected virtual void Start() GStruct414 result = InteractionsHandlerClass.Remove(Equipment.GetSlot(EquipmentSlot.Dogtag).ContainedItem, _inventoryController, false, true); if (result.Error != null) { - FikaPlugin.Instance.FikaLogger.LogWarning("CoopPlayer::Start: Error removing dog tag!"); + FikaPlugin.Instance.FikaLogger.LogWarning("CoopPlayer::SetupMainPlayer: Error removing dog tag!"); } } @@ -911,10 +913,12 @@ protected virtual void Start() CoopGame coopGame = (CoopGame)Singleton.Instance; if (coopGame.Location_0.Name.ToLower() == "laboratory") { - Item accessCardItem = Profile.Inventory.AllRealPlayerItems.FirstOrDefault(x => x.TemplateId == "5c94bbff86f7747ee735c08f"); - if (accessCardItem != null) + foreach (Item item in Profile.Inventory.AllRealPlayerItems) { - InteractionsHandlerClass.Remove(accessCardItem, _inventoryController, false, true); + if (item.TemplateId == "5c94bbff86f7747ee735c08f") + { + InteractionsHandlerClass.Remove(item, _inventoryController, false, true); + } } } }