mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-23 19:35:10 -06:00
Fix POH flashing correctly
This commit is contained in:
parent
c81bd3cd7c
commit
c96673989c
2 changed files with 7 additions and 6 deletions
|
|
@ -545,6 +545,11 @@ public class Player extends Entity {
|
|||
super.update();
|
||||
if (playerFlags.isUpdateSceneGraph()) {
|
||||
updateSceneGraph(false);
|
||||
// The scene graph rebuild wipes the client's build area. Reset lastViewport so MapChunkRenderer
|
||||
// re-synchronizes every visible chunk this tick (restoring scenery immediately and re-sending
|
||||
// each ground item exactly once), rather than only sending incremental updates for overlap.
|
||||
// This fixes POHs flashing their cached states (hotspots) on z transition.
|
||||
playerFlags.setLastViewport(new RegionChunk[13][13]);
|
||||
}
|
||||
PlayerRenderer.render(this);
|
||||
NPCRenderer.render(this);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package core.game.world.update
|
|||
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.world.map.RegionChunk
|
||||
import core.game.world.map.build.DynamicRegion
|
||||
import core.net.packet.PacketRepository
|
||||
import core.net.packet.context.ClearChunkContext
|
||||
import core.net.packet.out.ClearRegionChunk
|
||||
|
|
@ -41,12 +40,9 @@ object MapChunkRenderer {
|
|||
val previous = last[x][y] ?: continue
|
||||
if (containsChunk(current, previous)) {
|
||||
updated.add(previous)
|
||||
continue
|
||||
} else {
|
||||
PacketRepository.send(ClearRegionChunk::class.java, ClearChunkContext(player, previous))
|
||||
}
|
||||
if (previous.region is DynamicRegion) {
|
||||
continue //dynamic regions do not need a clear packet and briefly flash their cached states (e.g. POH with only hotspots) if you do send one
|
||||
}
|
||||
PacketRepository.send(ClearRegionChunk::class.java, ClearChunkContext(player, previous))
|
||||
}
|
||||
}
|
||||
sizeX = current.size
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue