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

Commit

Permalink
fix: fixed target choice!
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Nov 5, 2023
1 parent 589ee68 commit f659191
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"ClickingCount": 56810,
"ClickingCount": 56826,
"SaidUsers": []
}
6 changes: 2 additions & 4 deletions RotationSolver.Basic/Helpers/TargetFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ internal static BattleChara DefaultFindHostile(IEnumerable<BattleChara> availabl
availableCharas = DefaultTargetingType(availableCharas);
}

float radius = availableCharas.FirstOrDefault()?.HitboxRadius ?? 0.5f;
return availableCharas.Where(c => c.HitboxRadius == radius)
.OrderBy(ObjectHelper.DistanceToPlayer).FirstOrDefault();
return availableCharas.FirstOrDefault();
}

internal static T FindTargetForMoving<T>(this IEnumerable<T> charas, bool mustUse) where T : GameObject
Expand Down Expand Up @@ -368,7 +366,7 @@ public static IEnumerable<T> GetObjectInRadius<T>(this IEnumerable<T> objects, f

private static IEnumerable<BattleChara> DefaultTargetingType(IEnumerable<BattleChara> charas)
{
if(DataCenter.Territory?.IsPvpZone ?? false)
if (DataCenter.Territory?.IsPvpZone ?? false)
{
return charas.OrderBy(p => p.CurrentHp);
}
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Basic/BRD_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ protected static bool SongEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction PvP_TheWardensPaean { get; } = new BaseAction(ActionID.PvP_TheWardensPaean)
public static IBaseAction PvP_TheWardensPaean { get; } = new BaseAction(ActionID.PvP_TheWardensPaean, ActionOption.Friendly)
{
StatusProvide = PvP_PitchPerfect.StatusNeed,
};
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Commands/RSCommands_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ public static void DoAction()
}

if (nextAction is BaseAction act1 && act1.IsPvP && !act1.IsFriendly
&& act1.Target is PlayerCharacter p)
&& act1.Target is PlayerCharacter p/* && p != Player.Object*/)
{
var hash = SocialUpdater.EncryptString(p);

//Don't attack authors and contributors!!
if (RotationUpdater.AuthorHashes.ContainsKey(hash)
|| DownloadHelper.ContributorsHash.Contains(hash))
{
Svc.Chat.PrintError("Please don't attack RS developers with RS!");
Svc.Chat.PrintError($"Please don't attack RS developers with RS by {act1}!");
return;
}
}
Expand Down

0 comments on commit f659191

Please sign in to comment.