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

Commit

Permalink
fix: update io for events.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed May 24, 2023
1 parent 0c44e66 commit 9e42f92
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions RotationSolver/Watcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,14 @@ private void UpdateRTTDetour(dynamic obj)

private static unsafe void ReceiveAbilityEffect(uint sourceId, IntPtr sourceCharacter, Vector3* pos, ActionEffectHeader* effectHeader, ActionEffect* effectArray, ulong* effectTargets)
{

if (Player.Available)
{
try
{
var set = new ActionEffectSet(sourceId, effectHeader, effectArray, effectTargets);

ActionFromSelf(sourceId, set, effectHeader->actionId);
ActionFromEnemy(sourceId, set);
ActionFromSelf(set);
ActionFromEnemy(set);
}
catch (Exception ex)
{
Expand All @@ -65,10 +64,10 @@ private static unsafe void ReceiveAbilityEffect(uint sourceId, IntPtr sourceChar
_receiveAbilityHook.Original(sourceId, sourceCharacter, pos, effectHeader, effectArray, effectTargets);
}

private static void ActionFromEnemy(uint sourceId, ActionEffectSet set)
private static void ActionFromEnemy(ActionEffectSet set)
{
//Check Source.
var source = Svc.Objects.SearchById(sourceId);
var source = set.Source;
if (source == null) return;
if (source is not BattleChara battle) return;
if (battle is PlayerCharacter) return;
Expand Down Expand Up @@ -109,13 +108,14 @@ private static void ActionFromEnemy(uint sourceId, ActionEffectSet set)
}
}

private static void ActionFromSelf(uint sourceId, ActionEffectSet set, uint id)
private static void ActionFromSelf(ActionEffectSet set)
{
if (sourceId != Player.Object.ObjectId) return;
if (set.Source.ObjectId != Player.Object.ObjectId) return;
if (set.Type != ActionType.Spell && set.Type != ActionType.Item) return;
if (set.Action == null) return;
if ((ActionCate)set.Action.ActionCategory.Value.RowId == ActionCate.AutoAttack) return;

var id = set.Action.RowId;
if(set.Action.ClassJob.Row > 0 || Enum.IsDefined((ActionID)id))
{
OtherConfiguration.AnimationLockTime[id] = set.AnimationLock;
Expand Down

0 comments on commit 9e42f92

Please sign in to comment.