Skip to content

Commit

Permalink
fix: flags.get(coord) now defaults to -1 instead of 0 if the zone arr…
Browse files Browse the repository at this point in the history
…ay is not allocated.

update version to 2.4.4
  • Loading branch information
Z-Kris committed Oct 18, 2023
1 parent 6da0816 commit 52e7658
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
kotlin.code.style=official
group=io.blurite
version=2.4.3
version=2.4.4
4 changes: 2 additions & 2 deletions src/main/kotlin/org/rsmod/pathfinder/ZoneFlags.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class ZoneFlags {
/**
* Gets the flag at the absolute coordinates [x, y, z], returning the [default] if the zone is not allocated.
*/
public inline operator fun get(x: Int, y: Int, z: Int, default: Int = 0): Int {
public inline operator fun get(x: Int, y: Int, z: Int, default: Int = -1): Int {
val zoneCoords = ZoneCoords(x shr 3, y shr 3, z)
val array = flags[zoneCoords.packedCoords] ?: return default
return array[zoneLocal(x, y)]
Expand Down Expand Up @@ -84,7 +84,7 @@ public class ZoneFlags {
/**
* Gets the flag at the absolute coordinates, returning the [default] if the zone is not allocated.
*/
public inline operator fun get(absoluteCoords: AbsoluteCoords, default: Int = 0): Int {
public inline operator fun get(absoluteCoords: AbsoluteCoords, default: Int = -1): Int {
return get(absoluteCoords.x, absoluteCoords.y, absoluteCoords.z, default)
}

Expand Down

0 comments on commit 52e7658

Please sign in to comment.