Better logic related to selecting / deselecting target-based actions (#2962)

This commit is contained in:
chairbender
2021-01-10 06:27:55 -08:00
committed by GitHub
parent aeb3c1832e
commit ee6c28aede
5 changed files with 42 additions and 11 deletions

View File

@@ -337,9 +337,9 @@ namespace Content.Client.UserInterface
actionSlot.EnableAction();
actionSlot.Cooldown = actionState.Cooldown;
// if we are targeting with an action now on cooldown, stop targeting
// if we are targeting for this action and it's now on cooldown, stop targeting if we're supposed to
if (SelectingTargetFor?.Action != null && SelectingTargetFor.Action == action &&
actionState.IsOnCooldown(_gameTiming))
actionState.IsOnCooldown(_gameTiming) && action.DeselectOnCooldown)
{
StopTargeting();
}
@@ -410,10 +410,10 @@ namespace Content.Client.UserInterface
// action is currently granted
actionSlot.EnableAction();
// if we are targeting with an action now on cooldown, stop targeting
// if we are targeting with an action now on cooldown, stop targeting if we should
if (SelectingTargetFor?.Action != null && SelectingTargetFor.Action == action &&
SelectingTargetFor.Item == itemEntity &&
actionState.IsOnCooldown(_gameTiming))
actionState.IsOnCooldown(_gameTiming) && action.DeselectOnCooldown)
{
StopTargeting();
}