From 1266a1b459a2ba685d9f63ed3edc6f075680883a Mon Sep 17 00:00:00 2001 From: Tooze Date: Mon, 8 Jun 2026 00:28:16 -0400 Subject: [PATCH] isWaitingArea and isInHalls --- .../minigame/barbassault/lobby/BALobby.kt | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/Server/src/main/content/minigame/barbassault/lobby/BALobby.kt b/Server/src/main/content/minigame/barbassault/lobby/BALobby.kt index 97db08eb8..67975816c 100644 --- a/Server/src/main/content/minigame/barbassault/lobby/BALobby.kt +++ b/Server/src/main/content/minigame/barbassault/lobby/BALobby.kt @@ -18,6 +18,7 @@ import core.game.node.entity.Entity import core.game.node.entity.impl.PulseManager import core.game.node.entity.player.Player import core.game.node.item.Item +import core.game.world.map.Location import core.game.world.map.zone.ZoneBorders import core.game.world.map.zone.ZoneRestriction import org.rs09.consts.Items @@ -251,26 +252,38 @@ class BALobby : InteractionListener, MapArea { fun handleWaveDoor(player: Player, node: Node,iface: Int){ val doorLoc = node.location val playerLoc = player.location - var wave = getBAWave(player) - if (wave == BARBWAVEDOOR[node.id]) { - val insideRoom = playerLoc.y <= doorLoc.y - val moveY = if (insideRoom) 1 else -1 - //ToDo fix walking trough wall when Using door from side. - if (insideRoom) { forceMove(player, playerLoc, doorLoc, 25, 60, null, 819) } - forceMove(player, playerLoc, playerLoc.transform(0, moveY, 0), 25, 60, null, 819) { - if (insideRoom) { - //player.baSession?.cancleStartingPhase() - abandonTeam(player) - closeOverlay(player) - if (node.id == Scenery.DOOR_20209) { BarbassQuickWaveActivity.removeQuickQue(player) } // needs to happen sooner - } else { - openOverlay(player, iface) - } + + if (getBAWave(player) != BARBWAVEDOOR[node.id]) return + + val insideRoom = isWaitingArea(playerLoc) + val moveY = if (insideRoom) 1 else -1 + //ToDo fix walking trough wall when Using door from side. + forceMove(player, playerLoc, playerLoc.transform(0, moveY, 0), 25, 60, null, 819) { + if (insideRoom) { + //player.baSession?.cancleStartingPhase() + abandonTeam(player) + closeOverlay(player) + if (node.id == Scenery.DOOR_20209) { BarbassQuickWaveActivity.removeQuickQue(player) } // needs to happen sooner + } else { + openOverlay(player, iface) } } + } + companion object { + fun isWaitingArea(location: Location): Boolean { + return QUICK_START.insideBorder(location) || waveLobbies.any { it.insideBorder(location) && it != MAIN_LOBBY } + } + fun isInHalls(location: Location): Boolean { + return getRegionBorders(10322).insideBorder(location) && + !QUICK_START.insideBorder(location) && + waveLobbies.none { + it != MAIN_LOBBY && it.insideBorder(location) + } + } + fun TeamToLobby(team: BarbTeam, wave: Int) { if (wave in 0..waveLobbies.size) { val targetLobby = waveLobbies[wave]