Merge pull request #1380 from Armored-Dragon/fix/controller-scripts-1376
Some checks are pending
Master API-docs CI Build and Deploy / Build and deploy API-docs (push) Waiting to run
Master Doxygen CI Build and Deploy / Build and deploy Doxygen documentation (push) Waiting to run

Fix breakage in controller scripts relating to hudRayPicks
This commit is contained in:
ksuprynowicz 2025-04-10 21:04:08 +02:00 committed by GitHub
commit a37811cbbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -357,11 +357,14 @@ Script.include("/~/system/libraries/controllers.js");
};
this.notPointingAtEntity = function (controllerData) {
var intersection = controllerData.rayPicks[this.hand];
var entityProperty = Entities.getEntityProperties(intersection.objectID, "type");
var entityType = entityProperty.type;
var hudRayPick = controllerData.hudRayPicks[this.hand];
if (!hudRayPick.intersects) return false;
var point2d = this.calculateNewReticlePosition(hudRayPick.intersection);
if ((intersection.type === Picks.INTERSECTED_ENTITY && entityType === "Web") ||
intersection.type === Picks.INTERSECTED_OVERLAY || Window.isPointOnDesktopWindow(point2d)) {
return true;