Fix node place and dig buffering

This commit is contained in:
mrkubax10 2024-06-15 11:46:14 +02:00
parent c7e74f6ec5
commit 8f0896da38

View File

@ -158,18 +158,17 @@ void EditmodeHUD::update(double delta) {
update_position_text();
if(camera_controller->offset_changed() || local_player.is_moving() || m_chunk_manager.get_updated_chunks()>0)
update_ray();
if(m_ray.is_hit()) {
if(camera_controller->is_place_node_req()) {
// Call these even if ray didn't hit to reset place and dig node flags
if(camera_controller->is_place_node_req() && m_ray.is_hit()) {
m_chunk_manager.try_place(m_ray.get_next_node(), m_selected_node);
m_chunk_manager.add_node(m_selected_node, m_ray.get_next_node());
update_ray();
}
else if(camera_controller->is_dig_node_req()) {
else if(camera_controller->is_dig_node_req() && m_ray.is_hit()) {
m_chunk_manager.try_place(m_ray.get_hit_node(), 0);
m_chunk_manager.add_node(0, m_ray.get_hit_node());
update_ray();
}
}
if(m_chat->is_opened()) {
if(m_toolbox_messagebox) {