mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-24 03:45:13 -06:00
Fix flashing
This commit is contained in:
parent
0ca71d6bca
commit
7c4b0f19dd
3 changed files with 9 additions and 7 deletions
|
|
@ -172,7 +172,7 @@ public final class HouseManager {
|
|||
}
|
||||
|
||||
private void submitCloseLoadInterfacePulse(Player player) {
|
||||
GameWorld.getPulser().submit(new Pulse(2, player) {
|
||||
GameWorld.getPulser().submit(new Pulse(1, player) {
|
||||
@Override
|
||||
public boolean pulse() {
|
||||
player.getInterfaceManager().close();
|
||||
|
|
|
|||
|
|
@ -393,11 +393,11 @@ public class RegionChunk {
|
|||
if (dyn == stat) {
|
||||
continue;
|
||||
}
|
||||
if (stat != null) {
|
||||
if (stat != null && (dyn == null || !dyn.isRenderable())) {
|
||||
ClearScenery.write(buffer, stat);
|
||||
updated = true;
|
||||
}
|
||||
if (dyn != null) {
|
||||
if (dyn != null && dyn.isRenderable()) {
|
||||
ConstructScenery.write(buffer, dyn);
|
||||
updated = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package core.game.world.update
|
|||
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.world.map.RegionChunk
|
||||
import core.game.world.map.RegionManager
|
||||
import core.game.world.map.build.DynamicRegion
|
||||
import core.net.packet.PacketRepository
|
||||
import core.net.packet.context.ClearChunkContext
|
||||
import core.net.packet.out.ClearRegionChunk
|
||||
|
|
@ -28,7 +30,7 @@ object MapChunkRenderer {
|
|||
for (dcx in -buildAreaDepth..+buildAreaDepth) {
|
||||
val addX = ArrayList<RegionChunk>()
|
||||
for (dcy in -buildAreaDepth..+buildAreaDepth) {
|
||||
val newloc = player.location.chunkBase.transform(dcx*8, dcy*8, player.location.z)
|
||||
val newloc = player.location.transform(dcx*8, dcy*8, 0)
|
||||
addX.add(newloc.chunk)
|
||||
}
|
||||
current.add(addX)
|
||||
|
|
@ -39,10 +41,10 @@ object MapChunkRenderer {
|
|||
val sizeY: Int = last[x].size
|
||||
for (y in 0 until sizeY) {
|
||||
val previous = last[x][y] ?: continue
|
||||
if (!containsChunk(current, previous)) {
|
||||
PacketRepository.send(ClearRegionChunk::class.java, ClearChunkContext(player, previous))
|
||||
} else {
|
||||
if (containsChunk(current, previous)) {
|
||||
updated.add(previous)
|
||||
} else if (previous.region !is DynamicRegion) { //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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue