From b4ab1a714cbb1e60fe7d852a91c8bb648f522812 Mon Sep 17 00:00:00 2001 From: Ed Date: Sun, 6 Apr 2025 14:05:04 +0300 Subject: [PATCH] Update CP14SharedFarmingSystem.Interactions.cs --- .../Farming/CP14SharedFarmingSystem.Interactions.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Content.Shared/_CP14/Farming/CP14SharedFarmingSystem.Interactions.cs b/Content.Shared/_CP14/Farming/CP14SharedFarmingSystem.Interactions.cs index f7059eaa79..11b5976ec4 100644 --- a/Content.Shared/_CP14/Farming/CP14SharedFarmingSystem.Interactions.cs +++ b/Content.Shared/_CP14/Farming/CP14SharedFarmingSystem.Interactions.cs @@ -204,11 +204,14 @@ public abstract partial class CP14SharedFarmingSystem return false; } - if (_map.GetAnchoredEntities((map.Value, gridComp), position).ToList().Count > 0) + foreach (var anchored in _map.GetAnchoredEntities((map.Value, gridComp), position)) { - if (user is not null && _timing.IsFirstTimePredicted && _net.IsClient) - _popup.PopupEntity(Loc.GetString("cp14-farming-soil-occupied"), user.Value, user.Value); - return false; + if (PlantQuery.TryComp(anchored, out var plant)) + { + if (user is not null && _timing.IsFirstTimePredicted && _net.IsClient) + _popup.PopupEntity(Loc.GetString("cp14-farming-soil-occupied"), user.Value, user.Value); + return false; + } } return true;