Send the info whether the dragged entity is a token or a template to the other players (fixes a snapping issue in other players clients)
This commit is contained in:
+8
-2
@@ -33,8 +33,11 @@ export class DragRulerRuler extends Ruler {
|
||||
|
||||
toJSON() {
|
||||
const json = super.toJSON();
|
||||
if (this.draggedEntity)
|
||||
if (this.draggedEntity) {
|
||||
const isToken = this.draggedEntity instanceof Token;
|
||||
json["draggedEntityIsToken"] = isToken;
|
||||
json["draggedEntity"] = this.draggedEntity.id;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -44,7 +47,10 @@ export class DragRulerRuler extends Ruler {
|
||||
return;
|
||||
|
||||
if (data.draggedEntity) {
|
||||
this.draggedEntity = canvas.tokens.get(data.draggedEntity);
|
||||
if (data.draggedEntityIsToken)
|
||||
this.draggedEntity = canvas.tokens.get(data.draggedEntity);
|
||||
else
|
||||
this.draggedEntity = canvas.templates.get(data.draggedEntity);
|
||||
}
|
||||
super.update(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user