Skip to content

Commit 2bc6302

Browse files
committed
Cleaning up some
1 parent 206aa4a commit 2bc6302

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

src/game-engine/net/outbound-packets.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,6 @@ export class OutboundPackets {
577577

578578
packet.openBitBuffer();
579579

580-
// @TODO build around the player!
581-
// House room offsets and junk no matter where they are within the instance
582-
583580
const mapWorldX = mapData.position.x;
584581
const mapWorldY = mapData.position.y;
585582

@@ -589,14 +586,8 @@ export class OutboundPackets {
589586
const offsetX = playerChunk.position.x - (topCornerMapChunk.position.x - 2);
590587
const offsetY = playerChunk.position.y - (topCornerMapChunk.position.y - 2);
591588

592-
const centerChunkX = 6;
593-
const centerChunkY = 6;
594-
595-
const centerOffsetX = offsetX - centerChunkX;
596-
const centerOffsetY = offsetY - centerChunkY;
597-
598-
console.log(topCornerMapChunk.position.x, topCornerMapChunk.position.y);
599-
console.log(playerChunk.position.x, playerChunk.position.y);
589+
const centerOffsetX = offsetX - 6; // 6 === center
590+
const centerOffsetY = offsetY - 6; // 6 === center
600591

601592
for(let level = 0; level < 4; level++) {
602593
for(let x = 0; x < 13; x++) {
@@ -615,6 +606,7 @@ export class OutboundPackets {
615606
if(mapTileOffsetY > 12) {
616607
mapTileOffsetY = 12;
617608
}
609+
618610
const tileData: number | null = mapData.tileData[level][mapTileOffsetX][mapTileOffsetY];
619611
packet.putBits(1, tileData === null && !mapData.emptySpace ? 0 : 1);
620612

src/game-engine/world/actor/player/player.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ export class Player extends Actor {
395395
this.walkingQueue.process();
396396

397397
if(this.updateFlags.mapRegionUpdateRequired) {
398-
if(this.metadata.customMap) {
398+
if(this.position.x >= 6400) { // Custom map drawing area is anywhere x >= 6400 on the map
399399
this.outgoingPackets.constructMapRegion(this.metadata.customMap);
400400
} else {
401401
this.outgoingPackets.updateCurrentMapChunk();
@@ -428,10 +428,6 @@ export class Player extends Actor {
428428
this.metadata['teleporting'] = null;
429429
}
430430

431-
if(this.metadata.customMap) {
432-
delete this.metadata.customMap;
433-
}
434-
435431
resolve();
436432
});
437433
}

0 commit comments

Comments
 (0)