Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Commit

Permalink
Correctly merge local/app transforms (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenvergenz authored Aug 30, 2019
1 parent fc6bf97 commit 6fab7f6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/sdk/src/adapters/multipeer/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,11 @@ export class Session extends EventEmitter {
// so it doesn't desync from the updated one
const cacheTransform = syncActor.initialization.message.payload.actor.transform;
const patchTransform = message.payload.actor.transform;
if (patchTransform && !patchTransform.local) {
cacheTransform.local = undefined;
} else if (patchTransform && !patchTransform.app) {
cacheTransform.app = undefined;
if (patchTransform && patchTransform.app && cacheTransform.local) {
delete cacheTransform.local.position;
delete cacheTransform.local.rotation;
} else if (patchTransform && patchTransform.local) {
delete cacheTransform.app;
}
}
}
Expand Down

0 comments on commit 6fab7f6

Please sign in to comment.