feat(game): add Z coordinate to warps

This commit is contained in:
LananaHWP authored and Fiereu committed 2026-05-26 16:15:48 +02:00
1 parent 4e367fb5bb
commit 374aae68f6
7 files changed
+3842 -1284

No files matched your search

@@ -340,6 +340,7 @@ class LoginService(
mapId = other.mapId,
x = other.x.toInt(),
y = other.y.toInt(),
z = 0,
facing = other.facingDirection,
status = de.fiereu.openmmo.common.enums.EntityStatus.NONE,
hasFollower = otherParty.isNotEmpty(),
@@ -358,6 +359,7 @@ class LoginService(
mapId = mapId,
x = info.positionX.toInt(),
y = info.positionY.toInt(),
z = 0,
facing = facing,
status = de.fiereu.openmmo.common.enums.EntityStatus.NONE,
hasFollower = hasFollower,
@@ -18,6 +18,7 @@ class MapLoadService(private val packetSender: PacketSender) {
fun createLoadEntity(
info: CharacterInfo,
facing: Direction = Direction.DOWN,
z: Int = 0,
): LoadEntityPacket {
return LoadEntityPacket(
entityId = info.id,
@@ -28,6 +29,7 @@ class MapLoadService(private val packetSender: PacketSender) {
mapId = info.positionMapId.toInt(),
x = info.positionX.toInt(),
y = info.positionY.toInt(),
z = z,
facing = facing,
status = de.fiereu.openmmo.common.enums.EntityStatus.NONE,
hasFollower = false,
@@ -69,11 +69,15 @@ class WarpService(
}
}
val playerZ =
destMap?.warps?.find { it.x == warp.targetX && it.y == warp.targetY }?.elevation
?: warp.targetElevation
log.info {
"WARP EXIT: source=${sourceMap?.bankId}:${sourceMap?.mapId} ${sourceMap?.mapType} " +
"dest=${destMap?.bankId}:${destMap?.mapId} ${destMap?.mapType} " +
"target=(${warp.targetX},${warp.targetY}) final=($offsetX,$offsetY) " +
"facing=$warpFacing autoStep=$shouldAutoStepOffWarp"
"z=$playerZ facing=$warpFacing autoStep=$shouldAutoStepOffWarp"
}
val newInfo =
@@ -110,7 +114,7 @@ class WarpService(
// Real server warp sequence (from packets.db):
ctx.channel().writeAndFlush(MapTransitionPacket())
ctx.channel().writeAndFlush(RenderScreenPacket(false))
ctx.channel().writeAndFlush(mapLoadService.createLoadEntity(newInfo, warpFacing))
ctx.channel().writeAndFlush(mapLoadService.createLoadEntity(newInfo, warpFacing, playerZ))
ctx.channel().writeAndFlush(MapTransitionAckPacket(0))
if (destMap != null) {
@@ -60,7 +60,7 @@ object CharacterStore {
positionBankId = 51,
positionMapId = 3,
positionX = 4,
positionY = 2,
positionY = 4,
repelLeft = 0,
repelItemId = 0,
lureLeft = 0,
File diff suppressed because it is too large. Load diff