Skip to content

Commit 4361ebc

Browse files
Fixed object placement being offset if you go too high
I think this happens on the x axis too so I'll fix that later. Also this hasn't been tested in fullscreen yet.
1 parent 696e24e commit 4361ebc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,8 @@ async fn main() {
591591
let snapped_cam_y = cam_pos_y as i32;
592592
let snapped_x = ((mouse_x + (snapped_cam_x * 5)) / grid_size as i32) * grid_size as i32;
593593
let screen_height_range = (screen_height() - 600.0) * (40.0 / (1005.0 - 600.0));
594-
let snapped_y = (((mouse_y - (snapped_cam_y * 5)) - (screen_height() - (600.0 + screen_height_range)) as i32) / grid_size as i32) * grid_size as i32;
594+
let snapped_y_bugged = (((mouse_y - (snapped_cam_y * 5)) - (screen_height() - (600.0 + screen_height_range)) as i32) / grid_size as i32) * grid_size as i32;
595+
let snapped_y: i32 = snapped_y_bugged - if snapped_y_bugged <= -40 { 40 } else { 0 };
595596

596597
// This runs the loop function of all the loaded mods
597598
for lua_mod in mods.clone() {

0 commit comments

Comments
 (0)