mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-01 05:13:40 +01:00
Such utility, so many wows
This commit is contained in:
parent
ba8780e047
commit
98781f0bcd
2 changed files with 32 additions and 27 deletions
|
|
@ -43,33 +43,7 @@ namespace Dalamud.Game.ClientState.Actors.Types
|
|||
/// <summary>
|
||||
/// Gets the displayname of this <see cref="Actor" />.
|
||||
/// </summary>
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.name == null)
|
||||
{
|
||||
var i = 0;
|
||||
for (; i < this.actorStruct.Name.Length; i++)
|
||||
{
|
||||
if (this.actorStruct.Name[i] == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == this.actorStruct.Name.Length)
|
||||
{
|
||||
this.name = Encoding.UTF8.GetString(this.actorStruct.Name);
|
||||
Log.Warning($"Warning: Actor name exceeds underlying struct array length (name={this.name})");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.name = Encoding.UTF8.GetString(this.actorStruct.Name, 0, i);
|
||||
}
|
||||
}
|
||||
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
public string Name => this.name ??= Util.GetUTF8String(this.actorStruct.Name);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the actor ID of this <see cref="Actor" />.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue