Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't allow nameplate GameObject lookup when ObjectId is invalid #2137

Merged
merged 1 commit into from
Dec 4, 2024
Merged
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
19 changes: 16 additions & 3 deletions Dalamud/Game/Gui/NamePlate/NamePlateUpdateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,22 @@ internal NamePlateUpdateHandler(NamePlateUpdateContext context, int arrayIndex)
public ulong GameObjectId => this.gameObjectId ??= this.NamePlateInfo->ObjectId;

/// <inheritdoc/>
public IGameObject? GameObject => this.gameObject ??= this.context.ObjectTable[
this.context.Ui3DModule->NamePlateObjectInfoPointers[this.ArrayIndex]
.Value->GameObject->ObjectIndex];
public IGameObject? GameObject
{
get
{
if (this.GameObjectId == 0xE0000000)
{
// Skipping Ui3DModule lookup for invalid nameplate (NamePlateInfo->ObjectId is 0xE0000000). This
// prevents crashes around certain Doman Reconstruction cutscenes.
return null;
}

return this.gameObject ??= this.context.ObjectTable[
this.context.Ui3DModule->NamePlateObjectInfoPointers[this.ArrayIndex]
.Value->GameObject->ObjectIndex];
}
}

/// <inheritdoc/>
public IBattleChara? BattleChara => this.GameObject as IBattleChara;
Expand Down
Loading