Skip to content

Commit

Permalink
1.4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurochi51 committed Jul 20, 2024
1 parent 14e81e3 commit a2c22e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions PetScale/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public void UpdateConfig()
{
for (var i = 0; i < PetData.Count; i++)
{
if (PetData[i].CharacterName.Equals("Other players", StringComparison.Ordinal))
if (PetData[i].CharacterName.Equals(PetScale.Others, StringComparison.Ordinal))
{
PetData[i] = PetData[i] with { Generic = true, ContentId = 1 };
PetData[i] = PetData[i] with { Generic = true, ContentId = PetScale.OthersContendId };
}
else if (PetData[i].PetID is Enums.PetModel.AllPets)
{
Expand Down
14 changes: 7 additions & 7 deletions PetScale/PetScale.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public sealed class PetScale : IDalamudPlugin
{
private const string CommandName = "/pscale";
public const string Others = "Other players";
public const ulong OthersContendId = 1;

private readonly IDalamudPluginInterface pluginInterface;
private readonly Configuration config;
Expand Down Expand Up @@ -180,9 +181,8 @@ private void OnFrameworkUpdate(IFramework framework)
{
if (requestedCache)
{
var csPlayer = (Character*)player.Address;
playerName ??= csPlayer->NameString;
RefreshCache(playerName, csPlayer);
playerName ??= player.Name.TextValue;
RefreshCache(playerName, clientState.LocalContentId, player.EntityId);
requestedCache = false;
}
}
Expand Down Expand Up @@ -417,12 +417,12 @@ private unsafe bool NewParse(BattleChara* pet, Character* character, bool isLoca
return petSet;
}

private unsafe void RefreshCache(string playerName, Character* player)
private unsafe void RefreshCache(string playerName, ulong contentId, uint entityId)
{
players.Clear();
players.Enqueue((playerName, player->ContentId));
players.Enqueue((Others, 1));
utilities.CachePlayerList(player->EntityId, players, BattleCharaSpan);
players.Enqueue((playerName, contentId));
players.Enqueue((Others, OthersContendId));
utilities.CachePlayerList(entityId, players, BattleCharaSpan);
}

private unsafe void SetScale(BattleChara* pet, in PetStruct userData, string petName)
Expand Down
2 changes: 1 addition & 1 deletion PetScale/PetScale.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Authors></Authors>
<Company></Company>
<Version>1.3.0.0</Version>
<Version>1.4.0.0</Version>
<Description>Customize pet scale.</Description>
<Copyright></Copyright>
<PackageProjectUrl>https://github.com/Kurochi51/PetScale</PackageProjectUrl>
Expand Down

0 comments on commit a2c22e0

Please sign in to comment.