1
0
forked from noxious/server

Dont TP GM if already in given zone

This commit is contained in:
Dennis Postma 2024-09-20 20:34:38 +02:00
parent 5b2bea0dbe
commit 4a3a660f12

View File

@ -49,6 +49,11 @@ export default class TeleportCommandEvent {
return return
} }
if (this.socket.character.zoneId === zone.id) {
this.socket.emit('notification', { title: 'Server message', message: 'You are already in that zone' })
return
}
// Remove character from current zone // Remove character from current zone
this.io.to(this.socket.character.zoneId.toString()).emit('zone:character:leave', this.socket.character.id) this.io.to(this.socket.character.zoneId.toString()).emit('zone:character:leave', this.socket.character.id)
this.socket.leave(this.socket.character.zoneId.toString()) this.socket.leave(this.socket.character.zoneId.toString())