diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-22 02:19:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-22 12:48:16 +0300 |
commit | 620b960d3d8cfd90b9f0df6ba3671c33eccb8309 (patch) | |
tree | 64f69db4bf9d44f0a32d1c92b0714bf2dc98ff2d /source/blender/editors/physics/particle_boids.c | |
parent | bba60bb564cf5a16cfcac744d4ba82cf8eba3da9 (diff) |
Cleanup: style, use braces for editors
Diffstat (limited to 'source/blender/editors/physics/particle_boids.c')
-rw-r--r-- | source/blender/editors/physics/particle_boids.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/source/blender/editors/physics/particle_boids.c b/source/blender/editors/physics/particle_boids.c index cedb7d6cbc1..55fc49165c9 100644 --- a/source/blender/editors/physics/particle_boids.c +++ b/source/blender/editors/physics/particle_boids.c @@ -57,13 +57,15 @@ static int rule_add_exec(bContext *C, wmOperator *op) BoidRule *rule; BoidState *state; - if (!part || part->phystype != PART_PHYS_BOIDS) + if (!part || part->phystype != PART_PHYS_BOIDS) { return OPERATOR_CANCELLED; + } state = boid_get_current_state(part->boids); - for (rule = state->rules.first; rule; rule = rule->next) + for (rule = state->rules.first; rule; rule = rule->next) { rule->flag &= ~BOIDRULE_CURRENT; + } rule = boid_new_rule(type); rule->flag |= BOIDRULE_CURRENT; @@ -99,8 +101,9 @@ static int rule_del_exec(bContext *C, wmOperator *UNUSED(op)) BoidRule *rule; BoidState *state; - if (!part || part->phystype != PART_PHYS_BOIDS) + if (!part || part->phystype != PART_PHYS_BOIDS) { return OPERATOR_CANCELLED; + } state = boid_get_current_state(part->boids); @@ -113,8 +116,9 @@ static int rule_del_exec(bContext *C, wmOperator *UNUSED(op)) } rule = state->rules.first; - if (rule) + if (rule) { rule->flag |= BOIDRULE_CURRENT; + } DEG_relations_tag_update(bmain); DEG_id_tag_update(&part->id, ID_RECALC_GEOMETRY | ID_RECALC_PSYS_RESET); @@ -144,8 +148,9 @@ static int rule_move_up_exec(bContext *C, wmOperator *UNUSED(op)) BoidRule *rule; BoidState *state; - if (!part || part->phystype != PART_PHYS_BOIDS) + if (!part || part->phystype != PART_PHYS_BOIDS) { return OPERATOR_CANCELLED; + } state = boid_get_current_state(part->boids); for (rule = state->rules.first; rule; rule = rule->next) { @@ -180,8 +185,9 @@ static int rule_move_down_exec(bContext *C, wmOperator *UNUSED(op)) BoidRule *rule; BoidState *state; - if (!part || part->phystype != PART_PHYS_BOIDS) + if (!part || part->phystype != PART_PHYS_BOIDS) { return OPERATOR_CANCELLED; + } state = boid_get_current_state(part->boids); for (rule = state->rules.first; rule; rule = rule->next) { @@ -216,11 +222,13 @@ static int state_add_exec(bContext *C, wmOperator *UNUSED(op)) ParticleSettings *part = ptr.data; BoidState *state; - if (!part || part->phystype != PART_PHYS_BOIDS) + if (!part || part->phystype != PART_PHYS_BOIDS) { return OPERATOR_CANCELLED; + } - for (state = part->boids->states.first; state; state = state->next) + for (state = part->boids->states.first; state; state = state->next) { state->flag &= ~BOIDSTATE_CURRENT; + } state = boid_new_state(part->boids); state->flag |= BOIDSTATE_CURRENT; @@ -250,8 +258,9 @@ static int state_del_exec(bContext *C, wmOperator *UNUSED(op)) ParticleSettings *part = ptr.data; BoidState *state; - if (!part || part->phystype != PART_PHYS_BOIDS) + if (!part || part->phystype != PART_PHYS_BOIDS) { return OPERATOR_CANCELLED; + } for (state = part->boids->states.first; state; state = state->next) { if (state->flag & BOIDSTATE_CURRENT) { @@ -266,8 +275,9 @@ static int state_del_exec(bContext *C, wmOperator *UNUSED(op)) state = boid_new_state(part->boids); BLI_addtail(&part->boids->states, state); } - else + else { state = part->boids->states.first; + } state->flag |= BOIDSTATE_CURRENT; @@ -299,8 +309,9 @@ static int state_move_up_exec(bContext *C, wmOperator *UNUSED(op)) BoidSettings *boids; BoidState *state; - if (!part || part->phystype != PART_PHYS_BOIDS) + if (!part || part->phystype != PART_PHYS_BOIDS) { return OPERATOR_CANCELLED; + } boids = part->boids; @@ -334,8 +345,9 @@ static int state_move_down_exec(bContext *C, wmOperator *UNUSED(op)) BoidSettings *boids; BoidState *state; - if (!part || part->phystype != PART_PHYS_BOIDS) + if (!part || part->phystype != PART_PHYS_BOIDS) { return OPERATOR_CANCELLED; + } boids = part->boids; |