Fix continuous triggering of buying shapes with controller

This commit is contained in:
nak 2026-03-16 19:46:35 +00:00
parent f73fa84ca6
commit 6c60821469

View file

@ -164,7 +164,7 @@
spawnClone();
notify("Spawned " + _shapeId + " (" + (live + 1) + "/" + owned + " active)");
_busy = false;
// _busy stays true until trigger release (stopNearTrigger/stopFarTrigger/clickUpOnEntity)
});
});
}
@ -175,9 +175,16 @@
_entityID = entityID;
};
this.clickDownOnEntity = function () {
onClickDown();
};
// Mouse
this.clickDownOnEntity = function () { onClickDown(); };
this.clickUpOnEntity = function () { _busy = false; };
// Controller — near (<0.3m) and far (>0.3m)
// Requires "Triggerable" checkbox enabled on the entity.
this.startNearTrigger = function () { onClickDown(); };
this.stopNearTrigger = function () { _busy = false; };
this.startFarTrigger = function () { onClickDown(); };
this.stopFarTrigger = function () { _busy = false; };
this.unload = function () {
_token = null;