Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/plugins/physics.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,5 +449,9 @@ function inject (bot, { physicsEnabled, maxCatchupTicks }) {
doPhysicsTimer = setInterval(doPhysics, PHYSICS_INTERVAL_MS)
}
})

bot._client.on('start_configuration', () => { shouldUsePhysics = false })
bot._client.on('finish_configuration', () => { shouldUsePhysics = true })

Comment on lines +454 to +455
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unconditionally setting shouldUsePhysics = true after finish_configuration may enable physics before the 'position' packet is received. The existing pattern (line 420) only enables physics after receiving the position packet to ensure the player position is properly initialized. Consider removing this line and relying on the 'position' packet handler to re-enable physics at the appropriate time.

Suggested change
bot._client.on('finish_configuration', () => { shouldUsePhysics = true })

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like good point @bmstefanski ? Position should be returned by server after entering play state

bot.on('end', cleanup)
}
Loading