fix for at least some of the actor table crashing

This commit is contained in:
meli 2020-03-28 15:46:34 -07:00
parent 4d18a063f7
commit 2bef760f71

View file

@ -65,6 +65,14 @@ namespace Dalamud.Interface
break;
case 2: {
var stateString = string.Empty;
// LocalPlayer is null in a number of situations (at least with the current visible-actors list)
// which would crash here.
if (this.dalamud.ClientState.Actors.Length == 0 || this.dalamud.ClientState.LocalPlayer == null)
{
ImGui.TextUnformatted("Data not ready.");
}
else
{
stateString += $"FrameworkBase: {this.dalamud.Framework.Address.BaseAddress.ToInt64():X}\n";
stateString += $"ActorTableLen: {this.dalamud.ClientState.Actors.Length}\n";
@ -89,6 +97,7 @@ namespace Dalamud.Interface
$" Level: {chara.Level} ClassJob: {chara.ClassJob.GameData.Name} CHP: {chara.CurrentHp} MHP: {chara.MaxHp} CMP: {chara.CurrentMp} MMP: {chara.MaxMp}\n";
;
}
}
ImGui.TextUnformatted(stateString);
}