From 3ce1acb0aa9d674199a5a5175e0e7756d760020d Mon Sep 17 00:00:00 2001 From: Bloodsoul Date: Wed, 22 Jul 2026 15:36:25 +0200 Subject: [PATCH] Skip update for fc placeholders while we receive empty data --- .../Library/FreeCompanyNamePlaceholder.cs | 14 ++++++++++++-- .../Library/FreeCompanyTagPlaceholder.cs | 9 ++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Umbra.Game/src/Script/Placeholders/Library/FreeCompanyNamePlaceholder.cs b/Umbra.Game/src/Script/Placeholders/Library/FreeCompanyNamePlaceholder.cs index a0d94287..897da7cd 100644 --- a/Umbra.Game/src/Script/Placeholders/Library/FreeCompanyNamePlaceholder.cs +++ b/Umbra.Game/src/Script/Placeholders/Library/FreeCompanyNamePlaceholder.cs @@ -1,4 +1,5 @@ -using FFXIVClientStructs.FFXIV.Client.UI.Info; +using Dalamud.Utility; +using FFXIVClientStructs.FFXIV.Client.UI.Info; namespace Umbra.Game.Script; @@ -12,6 +13,15 @@ internal class FreeCompanyNamePlaceholder() : ScriptPlaceholder( public unsafe void Update() { var fc = InfoProxyFreeCompany.Instance(); - Value = fc != null ? fc->NameString : ""; + + // While world visiting or during duty, fc info is not available. + // Currently, the NameString property also does not update when returning from a duty. + // This also keeps the placeholder from being updated when the player leaves their fc. + if (fc == null || fc->Id == 0 || fc->NameString.IsNullOrEmpty()) + { + return; + } + + Value = fc->NameString; } } diff --git a/Umbra.Game/src/Script/Placeholders/Library/FreeCompanyTagPlaceholder.cs b/Umbra.Game/src/Script/Placeholders/Library/FreeCompanyTagPlaceholder.cs index 4a4513d6..7a0eff04 100644 --- a/Umbra.Game/src/Script/Placeholders/Library/FreeCompanyTagPlaceholder.cs +++ b/Umbra.Game/src/Script/Placeholders/Library/FreeCompanyTagPlaceholder.cs @@ -11,6 +11,13 @@ internal class FreeCompanyTagPlaceholder(IObjectTable objectTable) : ScriptPlace [OnTick] public void Update() { - Value = objectTable.LocalPlayer is ICharacter c ? c.CompanyTag.TextValue : ""; + // The fc tag is not available in some cases e.g. world visiting or between areas. + // This also keeps the placeholder from being updated when the player leaves their fc. + if (objectTable.LocalPlayer is not ICharacter c || string.IsNullOrEmpty(c.CompanyTag.TextValue)) + { + return; + } + + Value = c.CompanyTag.TextValue; } }