@@ -86,13 +86,13 @@ export class World {
86
86
87
87
const objectChunk = this . chunkManager . getChunkForWorldPosition ( objectPosition ) ;
88
88
89
+ let customMap = false ;
89
90
if ( actor instanceof Player && actor . metadata . customMap ) {
91
+ customMap = true ;
90
92
const templateMapObject = this . findCustomMapObject ( actor , objectId , objectPosition ) ;
91
93
if ( templateMapObject ) {
92
94
return { object : templateMapObject , cacheOriginal : true } ;
93
95
}
94
-
95
- return { object : null , cacheOriginal : false } ;
96
96
}
97
97
98
98
let cacheOriginal = true ;
@@ -107,7 +107,7 @@ export class World {
107
107
tileModifications = this . globalInstance . getTileModifications ( objectPosition ) ;
108
108
}
109
109
110
- let landscapeObject = objectChunk . getFilestoreLandscapeObject ( objectId , objectPosition ) ;
110
+ let landscapeObject = customMap ? null : objectChunk . getFilestoreLandscapeObject ( objectId , objectPosition ) ;
111
111
if ( ! landscapeObject ) {
112
112
const tileObjects = [ ...tileModifications . mods . spawnedObjects ] ;
113
113
@@ -174,10 +174,21 @@ export class World {
174
174
const mapTemplateWorldY = tileY ;
175
175
const mapTemplateChunk = world . chunkManager . getChunkForWorldPosition ( new Position ( mapTemplateWorldX , mapTemplateWorldY , objectPosition . level ) ) ;
176
176
177
- const templateObjectPosition = new Position ( mapTemplateWorldX + getTemplateLocalX ( tileOrientation , objectLocalX , objectLocalY ) ,
178
- mapTemplateWorldY + getTemplateLocalY ( tileOrientation , objectLocalX , objectLocalY ) , objectPosition . level ) ;
177
+ const templateLocalX = getTemplateLocalX ( tileOrientation , objectLocalX , objectLocalY ) ;
178
+ const templateLocalY = getTemplateLocalY ( tileOrientation , objectLocalX , objectLocalY ) ;
179
+
180
+ if ( actor instanceof Player ) {
181
+ actor . sendMessage ( `Tile Orientation ${ tileOrientation } , Local ${ templateLocalX } ,${ templateLocalY } ` ) ;
182
+ }
183
+
184
+ const templateObjectPosition = new Position ( mapTemplateWorldX + templateLocalX ,
185
+ mapTemplateWorldY + templateLocalY , objectPosition . level ) ;
179
186
const realObject = mapTemplateChunk . getFilestoreLandscapeObject ( objectId , templateObjectPosition ) ;
180
187
188
+ if ( ! realObject ) {
189
+ return null ;
190
+ }
191
+
181
192
realObject . x = objectPosition . x ;
182
193
realObject . y = objectPosition . y ;
183
194
realObject . level = objectPosition . level ;
0 commit comments