Skip to content

Commit

Permalink
Merge pull request #6478 from mozilla/bitecs-fix-pen
Browse files Browse the repository at this point in the history
Fix pen VR
  • Loading branch information
keianhzo authored Mar 26, 2024
2 parents 190aca0 + cc3c62d commit 746413d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/systems/hold-system.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ import {
AEntity,
Networked,
MediaLoader,
Deletable,
PenActive
Deletable
} from "../bit-components";
import { canMove } from "../utils/permissions-utils";
import { canMove as canMoveEntity } from "../utils/bit-permissions-utils";
import { isPinned } from "../bit-systems/networking";
import { takeOwnership } from "../utils/take-ownership";
import { anyEntityWith, findAncestorWithComponents } from "../utils/bit-utils";
import { findAncestorWithComponents } from "../utils/bit-utils";

const GRAB_REMOTE_RIGHT = paths.actions.cursor.right.grab;
const DROP_REMOTE_RIGHT = paths.actions.cursor.right.drop;
Expand Down Expand Up @@ -88,8 +87,7 @@ function grab(world, userinput, queryHovered, held, grabPath) {
target &&
userinput.get(grabPath) &&
(!isEntityPinned || AFRAME.scenes[0].is("frozen")) &&
hasPermissionToGrab(world, target) &&
!anyEntityWith(world, PenActive)
hasPermissionToGrab(world, target)
) {
if (hasComponent(world, Networked, target)) {
takeOwnership(world, target);
Expand All @@ -101,7 +99,7 @@ function grab(world, userinput, queryHovered, held, grabPath) {

function drop(world, userinput, queryHeld, held, dropPath) {
const heldEid = queryHeld(world)[0];
if (heldEid && userinput.get(dropPath) && !anyEntityWith(world, PenActive)) {
if (heldEid && userinput.get(dropPath)) {
// TODO: Drop on ownership lost
removeComponent(world, held, heldEid);

Expand Down

0 comments on commit 746413d

Please sign in to comment.