Skip to content

Commit

Permalink
fix: fov changing based on player state was changed incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Jan 22, 2025
1 parent d0f7f57 commit 4ce95de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,7 @@ downloadAndOpenFile().then((downloadAction) => {
const ip = qs.get('ip')
const lastConnect = JSON.parse(localStorage.lastConnectOptions ?? {})
void connect({
botVersion: qs.get('version') ?? undefined,
...lastConnect, // todo mixing is not good idea
ip: ip || undefined
})
Expand Down
8 changes: 4 additions & 4 deletions src/rendererUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { options } from './optionsStorage'
export const watchFov = () => {
const updateFov = () => {
if (!bot) return
let fovSetting = gameAdditionalState.isZooming ? 30 : options.fov
let fov = gameAdditionalState.isZooming ? 30 : options.fov
// todo check values and add transition
if (bot.controlState.sprint && !bot.controlState.sneak) {
fovSetting += 5
fov -= 5
}
if (gameAdditionalState.isFlying) {
fovSetting += 5
fov -= 5
}
viewer.camera.fov = fovSetting
viewer.camera.fov = fov
viewer.camera.updateProjectionMatrix()
}
updateFov()
Expand Down

0 comments on commit 4ce95de

Please sign in to comment.