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() {
|
toJSON() {
|
||||||
const json = super.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;
|
json["draggedEntity"] = this.draggedEntity.id;
|
||||||
|
}
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,7 +47,10 @@ export class DragRulerRuler extends Ruler {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (data.draggedEntity) {
|
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);
|
super.update(data);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user