From 567c4f647a15160e992af04e73c767d2cc388715 Mon Sep 17 00:00:00 2001 From: CobaltXII Date: Tue, 1 Jan 2019 21:17:57 -0500 Subject: [PATCH] Block placement is now centered around the player --- src/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6f6af5b..c7ecf28 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -642,9 +642,11 @@ int main(int argc, char** argv) if ((sdl_mouse_l || sdl_mouse_r) && block_timer == 0) { - float px = player_x; - float py = player_y; - float pz = player_z; + float px = player_x + player_hitbox.xr / 2.0f; + + float py = player_y + 0.2f; + + float pz = player_z + player_hitbox.zr / 2.0f; float ix = -sin(glm::radians(-rot_y_deg)); float iy = -tan(glm::radians(-rot_x_deg));