sashakoshka / m4kc

Minecraft 4k: decompiled, translated to C using SDL for graphics and input, and improved upon
78 stars 8 forks source link

Player coordinates are stored incorrectly #23

Closed sashakoshka closed 2 years ago

sashakoshka commented 2 years ago

Player coordinates are offset by 64. I believe this behavior was present in the original java version, to offset the broken rendering in negatives so that it did not appear in the world. The broken rendering can be mitigated by increasing this offset.

However, the player struct currently stores this these offset values. It should not do this, instead the values should be offset when rendering is taking place.

The player struct should store the real values because more things need the real values than the offset ones.

sashakoshka commented 2 years ago

I will work on this immediately because it will make saving player data easier.

sashakoshka commented 2 years ago

Apparently this offset is important for collision detection as well. It will start behaving erroneously in the same places the rendering would when it is not offset.