mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
Merge pull request #7531 from ZappoMan/optimizeDepthReticle
only do depth reticle depth check when the reticle is visible
This commit is contained in:
commit
cd548744f6
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