Remove OBACT from rigidbody_constraint.c and remove uneeded sanity check

This commit is contained in:
Dalai Felinto 2017-03-02 15:03:47 +01:00
parent aa845eed1e
commit 083bc48816
1 changed files with 4 additions and 6 deletions

View File

@ -117,8 +117,9 @@ static int rigidbody_con_add_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
SceneLayer *sl = CTX_data_scene_layer(C);
RigidBodyWorld *rbw = BKE_rigidbody_get_world(scene);
Object *ob = (scene) ? OBACT : NULL;
Object *ob = OBACT_NEW;
int type = RNA_enum_get(op->ptr, "type");
bool changed;
@ -166,11 +167,8 @@ static int rigidbody_con_remove_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
Object *ob = (scene) ? OBACT : NULL;
/* sanity checks */
if (scene == NULL)
return OPERATOR_CANCELLED;
SceneLayer *sl = CTX_data_scene_layer(C);
Object *ob = OBACT_NEW;
/* apply to active object */
if (ELEM(NULL, ob, ob->rigidbody_constraint)) {