From cee4f7b072513cb23511181678e0aa1b29df9672 Mon Sep 17 00:00:00 2001 From: ceikry Date: Sat, 25 Jun 2022 15:23:13 -0500 Subject: [PATCH] Fixed a bug where NPCs couldn't be attacked against walls --- .../kotlin/rs09/game/node/entity/combat/CombatSwingHandler.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/src/main/kotlin/rs09/game/node/entity/combat/CombatSwingHandler.kt b/Server/src/main/kotlin/rs09/game/node/entity/combat/CombatSwingHandler.kt index 7334df20c..89487c684 100644 --- a/Server/src/main/kotlin/rs09/game/node/entity/combat/CombatSwingHandler.kt +++ b/Server/src/main/kotlin/rs09/game/node/entity/combat/CombatSwingHandler.kt @@ -256,7 +256,7 @@ abstract class CombatSwingHandler(var type: CombatStyle?) { var result: InteractionType = InteractionType.STILL_INTERACT val maxIterations = next.getDistance(closestVictimTile).toInt() - for (i in 0..maxIterations) { //step towards the target tile, checking if anything would obstruct us on the way, and immediately breaking + returning if it does. + for (i in 0 until maxIterations) { //step towards the target tile, checking if anything would obstruct us on the way, and immediately breaking + returning if it does. next = next.transform(dir) result = checkStepInterval(dir, next) if (result == InteractionType.NO_INTERACT) break