Skip to content

Commit

Permalink
fix: log npc teleport/telejump correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Z-Kris committed Dec 23, 2024
1 parent 34b2d90 commit 9873961
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ internal class NpcInfoClient(
npc.steps,
npc.moveSpeed,
extendedInfo,
npc.jump,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ internal class NpcInfoClient(
npc.steps,
npc.moveSpeed,
extendedInfo,
npc.jump,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ internal class NpcInfoClient(
npc.steps,
npc.moveSpeed,
extendedInfo,
npc.jump,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ internal class NpcInfoClient(
npc.steps,
npc.moveSpeed,
extendedInfo,
npc.jump,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ internal class NpcInfoClient(
npc.steps,
npc.moveSpeed,
extendedInfo,
npc.jump,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public sealed interface NpcUpdateType {
public val steps: List<Int>,
public val moveSpeed: MoveSpeed,
public val extendedInfo: List<ExtendedInfo>,
public val jump: Boolean,
) : NpcUpdateType {
override fun equals(other: Any?): Boolean {
if (this === other) return true
Expand All @@ -81,6 +82,7 @@ public sealed interface NpcUpdateType {
if (steps != other.steps) return false
if (moveSpeed != other.moveSpeed) return false
if (extendedInfo != other.extendedInfo) return false
if (jump != other.jump) return false

return true
}
Expand All @@ -92,6 +94,7 @@ public sealed interface NpcUpdateType {
result = 31 * result + steps.hashCode()
result = 31 * result + moveSpeed.hashCode()
result = 31 * result + extendedInfo.hashCode()
result = 31 * result + jump.hashCode()
return result
}

Expand All @@ -102,7 +105,8 @@ public sealed interface NpcUpdateType {
"level=$level, " +
"steps=$steps, " +
"moveSpeed=$moveSpeed, " +
"extendedInfo=$extendedInfo" +
"extendedInfo=$extendedInfo, " +
"jump=$jump" +
")"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,17 @@ public class TextNpcInfoTranscriber(
continue
}
val npc = world.getNpc(index)
val newCoord = CoordGrid(update.level, update.x, update.z)
val coordShift = npc.coord != newCoord
val movementType =
when (update.moveSpeed) {
MoveSpeed.STATIONARY -> "ACTIVE"
MoveSpeed.STATIONARY -> {
when {
coordShift && update.jump -> "TELEJUMP"
coordShift -> "TELEPORT"
else -> "ACTIVE"
}
}
MoveSpeed.CRAWL -> "CRAWL"
MoveSpeed.WALK -> "WALK"
MoveSpeed.RUN -> "RUN"
Expand All @@ -222,6 +230,8 @@ public class TextNpcInfoTranscriber(
namedEnum("step1", step1)
namedEnum("step2", step2)
}
} else if (coordShift) {
coordGrid(update.level, update.x, update.z, "newcoord")
}
appendExtendedInfo(npc, update.extendedInfo)
}
Expand Down

0 comments on commit 9873961

Please sign in to comment.