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

Commit

Permalink
Actor will properly receive default ownership when authoritative user…
Browse files Browse the repository at this point in the history
… is assigned (#744)
  • Loading branch information
norybiak authored Apr 8, 2021
1 parent 04786b3 commit 0ab4117
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/sdk/src/core/contextInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,15 @@ export class ContextInternal {
actor.copy(sactor);
if (isNewActor) {
newActorIds.push(actor.id);
if (actor.rigidBody) {
if (actor.rigidBody) {
if (!actor.owner) {
actor.owner = this._rigidBodyDefaultOwner;
if (!this._rigidBodyDefaultOwner) {
this._rigidBodyOrphanSet.add(actor.id);
} else {
actor.owner = this._rigidBodyDefaultOwner;
this._rigidBodyOwnerMap.set(actor.id, actor.owner);
}
}
this._rigidBodyOwnerMap.set(actor.id, actor.owner);
}
}
});
Expand Down

0 comments on commit 0ab4117

Please sign in to comment.