Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: clean cast on data.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 22, 2023
1 parent 463465f commit 1d9a02d
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions ActionTimelineEx/Timeline/TimelineManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,31 +453,15 @@ private unsafe void OnCast(uint sourceId, IntPtr ptr)

var actionId = *(ushort*)ptr;

string name = string.Empty;
ushort icon = 0;
var action = Svc.Data.GetExcelSheet<Action>()?.GetRow(actionId);

if(action?.Cast100ms > 0)
{
name = action?.Name ?? string.Empty;
icon = actionId == 4 ? (ushort)118 //Mount
: action?.Icon ?? 0;
}
else
{
var item = Svc.Data.GetExcelSheet<Item>()?.GetRow(actionId);
if (item?.CastTimes > 0)
{
name = item?.Name ?? string.Empty;
icon = item?.Icon ?? 0;
}
}
Svc.Chat.Print(actionId.ToString());

var action = Svc.Data.GetExcelSheet<Action>()?.GetRow(actionId);

AddItem(new TimelineItem()
{
Name = name,
Icon = icon,
Name = action?.Name ?? string.Empty,
Icon = actionId == 4 ? (ushort)118 //Mount
: action?.Icon ?? 0,
StartTime = DateTime.Now,
GCDTime = GCD,
CastingTime = Player.Object.TotalCastTime - Player.Object.CurrentCastTime,
Expand Down

0 comments on commit 1d9a02d

Please sign in to comment.