From c53784c721af60805eee4ea85174c2acb8d290ba Mon Sep 17 00:00:00 2001 From: Ceikry Date: Fri, 25 Mar 2022 08:43:11 +0000 Subject: [PATCH] Fixed Barbarian fishing spot issue preventing it from acquiring a new location --- .../entity/skill/gather/fishing/barbfishing/SpotManager.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Server/src/main/kotlin/rs09/game/node/entity/skill/gather/fishing/barbfishing/SpotManager.kt b/Server/src/main/kotlin/rs09/game/node/entity/skill/gather/fishing/barbfishing/SpotManager.kt index 695c02450..670cb644f 100644 --- a/Server/src/main/kotlin/rs09/game/node/entity/skill/gather/fishing/barbfishing/SpotManager.kt +++ b/Server/src/main/kotlin/rs09/game/node/entity/skill/gather/fishing/barbfishing/SpotManager.kt @@ -53,8 +53,8 @@ fun getNewTTL(): Int{ } fun getNewLoc(): Location { - val possibleLoc = locations.toTypedArray().toMutableList() - possibleLoc.removeAll(usedLocations) + val possibleLoc = ArrayList() + for(loc in locations) if(usedLocations.contains(loc)) continue else possibleLoc.add(loc) val loc = possibleLoc.random() usedLocations.add(loc) return loc @@ -76,6 +76,7 @@ class BarbFishingSpot(var loc: Location? = null, var ttl: Int) : NPC(1176){ override fun handleTickActions() { if(location != loc) properties.teleportLocation = loc.also { ttl = getNewTTL() } if(ttl-- <= 0){ + usedLocations.remove(location) loc = getNewLoc() } }