|
|
@@ -17,7 +17,9 @@ module.exports = { |
|
|
|
}, |
|
|
|
|
|
|
|
collisionEnter: async function (obj) { |
|
|
|
if (!obj.player) |
|
|
|
const { player, syncer, instance: { physics, syncer: globalSyncer } } = obj; |
|
|
|
|
|
|
|
if (!player) |
|
|
|
return; |
|
|
|
else if (this.patronLevel) { |
|
|
|
if (!roles.isRoleLevel(obj, this.patronLevel, 'enter this area')) |
|
|
@@ -25,21 +27,20 @@ module.exports = { |
|
|
|
} |
|
|
|
|
|
|
|
if (obj.zoneName === this.toZone) { |
|
|
|
physics.removeObject(obj, obj.x, obj.y); |
|
|
|
|
|
|
|
obj.x = this.toPos.x; |
|
|
|
obj.y = this.toPos.y; |
|
|
|
|
|
|
|
const syncO = this.obj.syncer.o; |
|
|
|
syncO.x = obj.x; |
|
|
|
syncO.y = obj.y; |
|
|
|
|
|
|
|
process.send({ |
|
|
|
method: 'rezone', |
|
|
|
id: obj.serverId, |
|
|
|
args: { |
|
|
|
obj: simpleObj, |
|
|
|
newZone: this.toZone |
|
|
|
} |
|
|
|
}); |
|
|
|
syncer.set(false, null, 'x', obj.x); |
|
|
|
syncer.set(false, null, 'y', obj.y); |
|
|
|
|
|
|
|
physics.addObject(obj, obj.x, obj.y); |
|
|
|
|
|
|
|
globalSyncer.queue('onRespawn', { |
|
|
|
x: obj.x, |
|
|
|
y: obj.y |
|
|
|
}, [obj.serverId]); |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|