From: Lanius Trolling Date: Thu, 7 Mar 2024 12:49:26 +0000 (-0500) Subject: Remove `as?` from Kotlin/JS X-Git-Url: https://gitweb.starshipfights.net/?a=commitdiff_plain;h=5d8502d04d69a34be7afcbe2d629ebecfb4b5e53;p=factbooks Remove `as?` from Kotlin/JS --- diff --git a/src/mapMain/kotlin/info/mechyrdia/mapviewer/render.kt b/src/mapMain/kotlin/info/mechyrdia/mapviewer/render.kt index 7eff1b5..50be730 100644 --- a/src/mapMain/kotlin/info/mechyrdia/mapviewer/render.kt +++ b/src/mapMain/kotlin/info/mechyrdia/mapviewer/render.kt @@ -57,8 +57,11 @@ private fun CoroutineScope.openPtr(target: MapObjectPtr, currentSectorId: String setCurrentLocation(target) - if (panToSelection) - (mapPan as? SectorMapPan)?.moveCameraToSelection(galaxyMap.sectors.getValue(currentSectorId!!), selection!!) + if (panToSelection) { + val sectorMapPan = mapPan + if (sectorMapPan is SectorMapPan) + sectorMapPan.moveCameraToSelection(galaxyMap.sectors.getValue(currentSectorId!!), selection!!) + } } else { if (target == GalaxyPtr && currentSectorId != null) renderGalaxy(galaxyMap.sectors.getValue(currentSectorId).location)