fixed node texture shifting bugs
This commit is contained in:
@@ -28,6 +28,7 @@ impl Nodes {
|
||||
|
||||
pub fn set_node(&mut self, index: usize, value: u32) {
|
||||
self.node_buffer[self.active_buffer][index] = value;
|
||||
self.modified = true;
|
||||
}
|
||||
|
||||
pub fn shift(&mut self, offset: &Vector3<i32>) -> bool {
|
||||
@@ -38,6 +39,10 @@ impl Nodes {
|
||||
let (ox, oy, oz) = (offset.x, offset.y, offset.z);
|
||||
let size = NODE_TEX_SIZE as i32;
|
||||
|
||||
for i in self.node_buffer[b].iter_mut() {
|
||||
*i = 0;
|
||||
}
|
||||
|
||||
for x in max(0, -ox)..min(size-ox, size) {
|
||||
for y in max(0, -oy)..min(size-oy, size) {
|
||||
for z in max(0, -oz)..min(size-oz, size) {
|
||||
|
||||
Reference in New Issue
Block a user