mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 05:24:12 +02:00
only do depth reticle depth check when the reticle is visible
This commit is contained in:
parent
74633ca8c8
commit
bbca1ba6db
1 changed files with 1 additions and 2 deletions
|
@ -112,7 +112,7 @@ function autoHideReticle() {
|
|||
function checkReticleDepth() {
|
||||
var now = Date.now();
|
||||
var timeSinceLastDepthCheck = now - lastDepthCheckTime;
|
||||
if (timeSinceLastDepthCheck > TIME_BETWEEN_DEPTH_CHECKS) {
|
||||
if (timeSinceLastDepthCheck > TIME_BETWEEN_DEPTH_CHECKS && Reticle.visible) {
|
||||
var newDesiredDepth = desiredDepth;
|
||||
lastDepthCheckTime = now;
|
||||
var reticlePosition = Reticle.position;
|
||||
|
@ -160,7 +160,6 @@ function moveToDesiredDepth() {
|
|||
} else {
|
||||
newDepth = Reticle.depth + distanceToAdjustThisCycle;
|
||||
}
|
||||
|
||||
Reticle.setDepth(newDepth);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue