From 7d45133463f375252ba3e7e269cf1d27162aa1ee Mon Sep 17 00:00:00 2001 From: Maratons4 <81237150+Maratons4@users.noreply.github.com> Date: Fri, 23 Aug 2024 11:50:33 +0300 Subject: Fix: typo in corpse detection (#2386) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../features/mining/glacitemineshaft/CorpseLocator.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt index f7fdcad4d..3ea9ee4b1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt @@ -36,7 +36,7 @@ object CorpseLocator { */ private val mineshaftCoordsPattern by RepoPattern.pattern( "mineshaft.corpse.coords", - "x: (?-?\\d+), y: (?-?\\d+), z: (?-?\\d+)(?:.+)?" + "x: (?-?\\d+), y: (?-?\\d+), z: (?-?\\d+)(?:.+)?", ) private val sharedWaypoints: MutableList = mutableListOf() @@ -53,13 +53,15 @@ object CorpseLocator { val canSee = entity.getLorenzVec().canBeSeen(-1..3) if (canSee) { - ChatUtils.chat("Located a ${corpseType.displayText} and marked its location with a waypoint.") + val article = if (corpseType.displayText == "Umber Corpse") "an" else "a" + ChatUtils.chat("Located $article ${corpseType.displayText} and marked its location with a waypoint.") + MineshaftWaypoints.waypoints.add( MineshaftWaypoint( waypointType = corpseType, location = entity.getLorenzVec().add(y = 1), - isCorpse = true - ) + isCorpse = true, + ), ) } } @@ -70,7 +72,7 @@ object CorpseLocator { .filterNot { corpse -> sharedWaypoints.any { corpse.location.distance(it) <= 5 } } - .filter { it.location.distanceToPlayer() <= 5} + .filter { it.location.distanceToPlayer() <= 5 } .minByOrNull { it.location.distanceToPlayer() } ?: return val (x, y, z) = closestCorpse.location.toDoubleArray().map { it.toInt() } -- cgit