-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove resending blocks for obstructedPos #807
Conversation
bump |
…es that are not yourself
# Conflicts: # go.sum
bump |
merge plz |
// The function returns true if there is an entity in the way that could prevent the block from being placed. | ||
func (p *Player) obstructedPos(pos cube.Pos, b world.Block) bool { | ||
// The first bool indicates if there is an entity in the way that could prevent the block from being placed. | ||
// The second bool is used to check if the block should be updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you expand this documentation to explain why it should not be updated?
if e == p { | ||
resend = false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section isn't entirely clear to me. If any of the entities in this 7x7x7 bounding box is the player itself, it will not resend. This doesn't quite sound right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is enough latency the client position might be in the block that the client wants to be placed.
You can easily try this out by having >=150ms and stacking blocks under you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If anything I would first move this block inside of the if cube.AnyIntersections {}
block, because the player might not even be intersecting in the first place. But then I'm still not sure if it would work as expected. Imagine there was another player that this intersected with, in addition to the player itself, should it be resent or not?
It's kinda a hack I know, but go no other clue.
This is meant to remove block lag for high ping players.