diff --git a/Server/src/main/content/minigame/castlewars/CastleWarsGameState.kt b/Server/src/main/content/minigame/castlewars/CastleWarsGameState.kt index 46b52e72c..98cbed706 100644 --- a/Server/src/main/content/minigame/castlewars/CastleWarsGameState.kt +++ b/Server/src/main/content/minigame/castlewars/CastleWarsGameState.kt @@ -277,12 +277,11 @@ object CastleWarsGameState { fun registerClimbingRope(rope: Scenery, originalWall: Scenery) { val key = Location.create(rope.location) - val chunk = RegionManager.getRegionChunk(rope.location) rope.isActive = true rope.isRenderable = true activeClimbingRopes[key] = ActiveClimbingRope(rope, Scenery(originalWall)) - chunk.objects[rope.location.chunkOffsetX][rope.location.chunkOffsetY] = rope + SceneryBuilder.add(rope) } fun getClimbingRope(location: Location): Scenery? { @@ -291,15 +290,9 @@ object CastleWarsGameState { fun removeClimbingRope(location: Location, sendUpdate: Boolean = true): Boolean { val activeRope = activeClimbingRopes.remove(Location.create(location)) ?: return false - val chunk = RegionManager.getRegionChunk(activeRope.rope.location) activeRope.rope.isActive = false - chunk.objects[activeRope.rope.location.chunkOffsetX][activeRope.rope.location.chunkOffsetY] = - activeRope.originalWall - - if (sendUpdate) { - chunk.flag(ObjectUpdateFlag(activeRope.rope, true)) - } + SceneryBuilder.replace(activeRope.rope, activeRope.originalWall) return true } diff --git a/Server/src/main/content/minigame/castlewars/CastleWarsGameZone.kt b/Server/src/main/content/minigame/castlewars/CastleWarsGameZone.kt index 8831cf08c..d9aa4e91a 100644 --- a/Server/src/main/content/minigame/castlewars/CastleWarsGameZone.kt +++ b/Server/src/main/content/minigame/castlewars/CastleWarsGameZone.kt @@ -8,7 +8,7 @@ import core.game.node.entity.impl.PulseManager import core.game.node.entity.player.Player import core.game.system.timer.impl.Poison import core.game.world.map.Location -import core.game.world.map.RegionManager.getLocalNpcs +import core.game.world.map.RegionManager.getLocalNPCs import core.game.world.map.path.Pathfinder import core.game.world.map.zone.* @@ -103,7 +103,7 @@ class CastleWarsGameZone : MapZone("CastleWarsGame", true, ZoneRestriction.RANDO val isMovingUp = to.z > from.z val isChangingZLevel = to.z != from.z - for (n in getLocalNpcs(e, 5)) { + for (n in getLocalNPCs(e.location, 5)) { if (n.isInvisible || n === e) { continue } @@ -138,4 +138,3 @@ class CastleWarsGameZone : MapZone("CastleWarsGame", true, ZoneRestriction.RANDO return ZoneType.CASTLE_WARS.id } } - diff --git a/Server/src/main/content/minigame/castlewars/CastleWarsItemHandler.kt b/Server/src/main/content/minigame/castlewars/CastleWarsItemHandler.kt index 497a12bfd..ab29eed83 100644 --- a/Server/src/main/content/minigame/castlewars/CastleWarsItemHandler.kt +++ b/Server/src/main/content/minigame/castlewars/CastleWarsItemHandler.kt @@ -341,6 +341,6 @@ class CastleWarsItemHandler : InteractionListener { NPCs.BARRICADE_1532, NPCs.BARRICADE_1533, NPCs.BARRICADE_1534, NPCs.BARRICADE_1535 ) - return RegionManager.getLocalNpcs(location, radius).filter { it.id in barricadeIds && it.isActive } + return RegionManager.getLocalNPCs(location, radius).filter { it.id in barricadeIds && it.isActive } } }