Skip to content

Commit 53d12c2

Browse files
committed
fix: update cached npc ids after transform
1 parent 95ed1b3 commit 53d12c2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

transcriber/src/main/kotlin/net/rsprox/transcriber/state/SessionTracker.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ public class SessionTracker(
348348
if (blocks.isNotEmpty()) {
349349
val npc = world.getNpc(index)
350350
val transform = blocks.single()
351-
world.updateNpcName(npc.index, cache.getNpcType(transform.id)?.name)
351+
world.updateNpcName(npc.index, transform.id, cache.getNpcType(transform.id)?.name)
352352
}
353353
}
354354
NpcUpdateType.HighResolutionToLowResolution -> {

transcriber/src/main/kotlin/net/rsprox/transcriber/state/World.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,11 @@ public class World(
147147

148148
public fun updateNpcName(
149149
index: Int,
150-
name: String?,
150+
newId: Int,
151+
newName: String?,
151152
) {
152153
val old = getNpc(index)
153-
this.npcs[index] = Npc(old.index, old.id, old.creationCycle, old.coord, name)
154+
this.npcs[index] = Npc(old.index, newId, old.creationCycle, old.coord, newName)
154155
}
155156

156157
public fun removeNpc(index: Int) {

0 commit comments

Comments
 (0)