fn counter_end(i: usize, stack: &Stack, blocks: &mut WriteStorage<'_, Block>) {
        let mut above_hanging: bool = false;
        let mut above_counter: u32 = 0;

        if i < BLOCKS - COLS {
            let above = blocks.get(stack.from_i(i + COLS)).unwrap();
            above_hanging = above.state == "HANG";
            above_counter = above.counter;
        }
 
        let b = blocks.get_mut(stack.from_i(i)).unwrap();
        if above_hanging {
            change_state(b, "HANG"); 
            b.counter = above_counter;
        }
        else {
            change_state(b, "IDLE"); 
        }
    }
// change to idle on default
// if above isnt null and hanging, set the counter to the aboves counter
change to idle on default
if above isnt null and hanging, set the counter to the aboves counter
change to idle on default if above isnt null and hanging set the counter to the aboves counter
fn counter_end(i: usize, stack: &Stack, blocks: &mut WriteStorage<'_, Block>) {
        let mut above_hanging: bool = false;
        let mut above_counter: u32 = 0;
        if i < BLOCKS - COLS {
            let above = blocks.get(stack.from_i(i + COLS)).unwrap();
            above_hanging = above.state == "HANG";
            above_counter = above.counter;
        }
        let b = blocks.get_mut(stack.from_i(i)).unwrap();
        if above_hanging {
            change_state(b, "HANG"); 
            b.counter = above_counter;
        }
        else {
            change_state(b, "IDLE"); 
        }
    }
fn counter_end ( i : usize , stack : & Stack , blocks : & mut WriteStorage < ' _ , Block > ) { let mut above_hanging : bool = false ; let mut above_counter : u32 = 0 ; if i < BLOCKS - COLS { let above = blocks . get ( stack . from_i ( i + COLS ) ) . unwrap ( ) ; above_hanging = above . state == " " ; above_counter = above . counter ; } let b = blocks . get_mut ( stack . from_i ( i ) ) . unwrap ( ) ; if above_hanging { change_state ( b , " " ) ; b . counter = above_counter ; } else { change_state ( b , " " ) ; } }
change to idle on default
if above isnt null and hanging, set the counter to the aboves counter
change to idle on default if above isnt null and hanging set the counter to the aboves counter
i
usize
stack
&Stack
blocks
&mut WriteStorage<'_, Block>
i
usize
stack
&Stack
blocks
&mut WriteStorage<'_, Block>