getLocalNPCs and ChunkFlags

This commit is contained in:
aidan 2026-05-27 20:28:34 -05:00
parent 430d7e0467
commit 9300b98766
2 changed files with 4 additions and 4 deletions

View file

@ -197,7 +197,7 @@ class EW2Listeners : InteractionListener {
// find cart
val trackCenter = Location.create(1953, 5155, 2)
val existingCart = RegionManager.getLocalNpcs(trackCenter, 15).find { it.id in jigCartStates }
val existingCart = RegionManager.getLocalNPCs(trackCenter, 15).find { it.id in jigCartStates }
if (existingCart != null) {
// update appearance
if (existingCart.id != targetId) {
@ -451,7 +451,7 @@ class EW2Listeners : InteractionListener {
// find the cart
val trackCenter = Location.create(1953, 5155, 2)
val existingCart = RegionManager.getLocalNpcs(trackCenter, 15).find { it.id in jigCartStates }
val existingCart = RegionManager.getLocalNPCs(trackCenter, 15).find { it.id in jigCartStates }
if (existingCart == null) {
sendMessage(player, "CART MISSING. LOG IN AND OUT TO RESET IT.")
return@on true

View file

@ -5,7 +5,7 @@ import core.game.node.entity.npc.NPC
import core.game.node.entity.npc.NPCBehavior
import core.game.world.map.Location
import core.game.world.map.RegionManager
import core.game.world.map.build.RegionFlags
import core.game.world.map.build.ChunkFlags
import core.game.world.map.path.ClipMaskSupplier
import org.rs09.consts.NPCs
@ -38,6 +38,6 @@ class JigCartNPCBehavior : NPCBehavior(NPCs.JIG_CART_4913, NPCs.JIG_CART_4914, N
object CartClipper : ClipMaskSupplier {
override fun getClippingFlag (z: Int, x: Int, y: Int) : Int {
val flag = RegionManager.getClippingFlag(z, x, y)
return flag and (RegionFlags.SOLID_TILE.inv()) and (RegionFlags.TILE_OBJECT.inv()) and (RegionFlags.OBJ_10.inv())
return flag and (ChunkFlags.SOLID_TILE.inv()) and (ChunkFlags.TILE_OBJECT.inv()) and (ChunkFlags.OBJ_10.inv())
}
}