BGE: When creating a controller by linking a sensor and actuator, the created controller will always be an and controller instead of the last controller type added.

This commit is contained in:
Mitchell Stokes
2012-08-23 09:24:59 +00:00
parent e91e1814d0
commit fd2c3d1e30

View File

@@ -838,6 +838,7 @@ static void ui_add_smart_controller(bContext *C, uiBut *from, uiBut *to)
/* (3) add a new controller */
if (WM_operator_name_call(C, "LOGIC_OT_controller_add", WM_OP_EXEC_DEFAULT, NULL) & OPERATOR_FINISHED) {
cont = (bController *)ob->controllers.last;
cont->type = CONT_LOGIC_AND; /* Quick fix to make sure we always have an AND controller. It might be nicer to make sure the operator gives us the right one though... */
/* (4) link the sensor->controller->actuator */
tmp_but = MEM_callocN(sizeof(uiBut), "uiBut");