Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FFXIVClientStructs.FFXIV.Client.UI.Info;
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.UI.Info;

namespace Umbra.Game.Script;

Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}