~colbyhub/pocket_dust

2a93639991941af2867d8f65cece7dd4f64d713d — colbyhub 3 months ago f5617cc v1.0
Fix sand-teleporting bug
1 files changed, 6 insertions(+), 2 deletions(-)

M src/main.c
M src/main.c => src/main.c +6 -2
@@ 447,11 447,15 @@ particle_t* update_sand(uint8_t x, uint8_t y) {
        get_particle_material_id(get_particle(x, y + 1)) == MATERIAL_WATER_ID) {
      new_position.y = y + 1;
    } else if (get_particle_material_id(get_particle(x - 1, y + 1)) == MATERIAL_AIR_ID &&
        get_particle_material_id(get_particle(x - 1, y)) == MATERIAL_AIR_ID) {
        get_particle_material_id(get_particle(x - 1, y)) == MATERIAL_AIR_ID &&
        x > 0
        ) {
      new_position.x = x - 1;
      new_position.y = y + 1;
    } else if (get_particle_material_id(get_particle(x + 1, y + 1)) == MATERIAL_AIR_ID && 
        get_particle_material_id(get_particle(x + 1, y)) == MATERIAL_AIR_ID) {
        get_particle_material_id(get_particle(x + 1, y)) == MATERIAL_AIR_ID &&
        x < CANVAS_WIDTH - 1
        ) {
      new_position.x = x + 1;
      new_position.y = y + 1;
    }