From 7f97d8372d952a1ed36051acf9c6b936bb8dd9f0 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Fri, 1 Nov 2024 11:02:18 -0400 Subject: [PATCH 1/3] Review sale precondition check order --- .../Cargo/Systems/CargoSystem.Shuttle.cs | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs index fd10a776c18..dce8ea06f91 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs @@ -10,6 +10,7 @@ using Robust.Shared.Map; using Robust.Shared.Random; using Robust.Shared.Audio; +using Content.Shared.Mind.Components; // Frontier namespace Content.Server.Cargo.Systems; @@ -319,15 +320,10 @@ private void GetPalletGoods(EntityUid consoleUid, EntityUid gridUid, out HashSet private bool CanSell(EntityUid uid, TransformComponent xform) { - if (_mobQuery.HasComponent(uid)) - { - if (_mobQuery.GetComponent(uid).CurrentState == MobState.Alive) - { - return false; - } - - return true; - } + // Frontier: Look for blacklisted items and stop the selling of the container. + if (_blacklistQuery.HasComponent(uid)) + return false; + // End Frontier var complete = IsBountyComplete(uid, out var bountyEntities); @@ -342,11 +338,10 @@ private bool CanSell(EntityUid uid, TransformComponent xform) return false; } - // Look for blacklisted items and stop the selling of the container. - if (_blacklistQuery.HasComponent(uid)) - { - return false; - } + // Frontier: allow selling dead mobs + if (_mobQuery.TryComp(uid, out var mob)) + return mob.CurrentState == MobState.Dead; + // End Frontier return true; } From 5e6405dafbf1599954e92c6c3ff90d35d169b49f Mon Sep 17 00:00:00 2001 From: Whatstone Date: Fri, 1 Nov 2024 11:13:59 -0400 Subject: [PATCH 2/3] Frontier pets shouldn't be sold --- Resources/Prototypes/Entities/Mobs/NPCs/pets.yml | 1 + Resources/Prototypes/_NF/Entities/Mobs/NPCs/pets.yml | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml b/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml index de9a4ac6147..7e5474f7440 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml @@ -825,6 +825,7 @@ attributes: proper: true gender: male + - type: CargoSellBlacklist # Frontier - type: entity name: Tropico diff --git a/Resources/Prototypes/_NF/Entities/Mobs/NPCs/pets.yml b/Resources/Prototypes/_NF/Entities/Mobs/NPCs/pets.yml index 37b57da2500..97e18c8d479 100644 --- a/Resources/Prototypes/_NF/Entities/Mobs/NPCs/pets.yml +++ b/Resources/Prototypes/_NF/Entities/Mobs/NPCs/pets.yml @@ -40,6 +40,7 @@ - Cat - PetsNT - type: ShowJobIcons + - type: CargoSellBlacklist - type: entity name: Clarpy @@ -85,6 +86,7 @@ factions: - Cat - PirateNF + - type: CargoSellBlacklist - type: entity name: Cappy @@ -146,12 +148,13 @@ - type: InteractionPopup interactSuccessSound: path: /Audio/_NF/Animals/nfsdcat_meow.ogg + - type: CargoSellBlacklist - type: entity name: Clugg parent: [NFMobPet, MobCatCaracalGhost] id: MobCatClugg - description: + description: components: - type: Sprite drawdepth: Mobs @@ -180,7 +183,7 @@ name: Mistake parent: MobCatGhost id: MobCatMistake - description: ??? + description: "???" components: - type: Sprite drawdepth: Mobs @@ -256,4 +259,5 @@ - enum.DamageStateVisualLayers.Base: kobold: YipYipColors - horns: - horns_curled: YipYipHornColors \ No newline at end of file + horns_curled: YipYipHornColors + - type: CargoSellBlacklist From 351c1e751c590b46e7374a638858af2e7957fbe7 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Fri, 1 Nov 2024 11:42:42 -0400 Subject: [PATCH 3/3] Push dead mob check above recursive chunk --- Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs index dce8ea06f91..2270374fb86 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs @@ -323,6 +323,10 @@ private bool CanSell(EntityUid uid, TransformComponent xform) // Frontier: Look for blacklisted items and stop the selling of the container. if (_blacklistQuery.HasComponent(uid)) return false; + + // Frontier: allow selling dead mobs + if (_mobQuery.TryComp(uid, out var mob) && mob.CurrentState != MobState.Dead) + return false; // End Frontier var complete = IsBountyComplete(uid, out var bountyEntities); @@ -338,11 +342,6 @@ private bool CanSell(EntityUid uid, TransformComponent xform) return false; } - // Frontier: allow selling dead mobs - if (_mobQuery.TryComp(uid, out var mob)) - return mob.CurrentState == MobState.Dead; - // End Frontier - return true; }