From 8d2f86cb04d163df82596552769113f47e5ed1a9 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sun, 1 Jan 2023 15:05:51 +0100 Subject: [PATCH] fix(combat): do not return successfully when walk position is equal to target position --- .../NosSmooth.Extensions.Combat.csproj | 6 +++--- .../Operations/WalkInRangeOperation.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Extensions/NosSmooth.Extensions.Combat/NosSmooth.Extensions.Combat.csproj b/Extensions/NosSmooth.Extensions.Combat/NosSmooth.Extensions.Combat.csproj index f7aa6a487fa0cb7884a98409991d85f5d97ad41b..d43dcedf09de5024ecd5bb263391febaf7c4f9b7 100644 --- a/Extensions/NosSmooth.Extensions.Combat/NosSmooth.Extensions.Combat.csproj +++ b/Extensions/NosSmooth.Extensions.Combat/NosSmooth.Extensions.Combat.csproj @@ -5,10 +5,10 @@ enable 10 net7.0 - 0.0.2 + 0.0.3 Manages NosSmooth combat state, currently exposing a simple technique to kill one enemy at a time. - 0.0.2 - 0.0.2 + 0.0.3 + 0.0.3 https://github.com/Rutherther/NosSmooth/ MIT diff --git a/Extensions/NosSmooth.Extensions.Combat/Operations/WalkInRangeOperation.cs b/Extensions/NosSmooth.Extensions.Combat/Operations/WalkInRangeOperation.cs index 7dfc7cd733094d13e4ab7f3eb891016b39f75fba..e579179dd283b77987fc6c502971185936a5ff15 100644 --- a/Extensions/NosSmooth.Extensions.Combat/Operations/WalkInRangeOperation.cs +++ b/Extensions/NosSmooth.Extensions.Combat/Operations/WalkInRangeOperation.cs @@ -68,7 +68,7 @@ public record WalkInRangeOperation } var closePosition = GetClosePosition(currentPosition.Value, position.Value, distance); - if (closePosition == position) + if (closePosition == currentPosition) { return Result.FromSuccess(); }