Fixed bug with tokens that were attatched to a vehicle being rendered on top of fog

This commit is contained in:
Mitchell McCaffrey
2020-07-20 19:14:46 +10:00
parent 7252efc7e9
commit 58ac649aa8
2 changed files with 36 additions and 33 deletions

View File

@@ -78,12 +78,12 @@ function MapToken({
const mountChanges = {};
if (token && token.isVehicle) {
const layer = tokenGroup.getLayer();
const parent = tokenGroup.getParent();
const mountedTokens = tokenGroup.find(".token");
for (let mountedToken of mountedTokens) {
// Save and restore token position after moving layer
const position = mountedToken.absolutePosition();
mountedToken.moveTo(layer);
mountedToken.moveTo(parent);
mountedToken.absolutePosition(position);
mountChanges[mountedToken.id()] = {
...mapState.tokens[mountedToken.id()],