synched with trunk at revision 30597
[blender.git] / source / blender / blenkernel / intern / sca.c
index f5ca7ee..6ff15b3 100644 (file)
@@ -391,6 +391,7 @@ void init_actuator(bActuator *act)
        bObjectActuator *oa;
        bRandomActuator *ra;
        bSoundActuator *sa;
+       bSteeringActuator *sta;
        
        if(act->data) MEM_freeN(act->data);
        act->data= 0;
@@ -464,6 +465,13 @@ void init_actuator(bActuator *act)
        case ACT_ARMATURE:
                act->data = MEM_callocN(sizeof( bArmatureActuator ), "armature act");
                break;
+       case ACT_STEERING:
+               act->data = MEM_callocN(sizeof( bSteeringActuator), "steering act");
+               sta = act->data;
+               sta->acceleration = 3.f;
+               sta->turnspeed = 120.f;
+               sta->dist = 1.f;
+               sta->velocity= 3.f;
        default:
                ; /* this is very severe... I cannot make any memory for this        */
                /* logic brick...                                                    */
@@ -606,6 +614,7 @@ void sca_remove_ob_poin(Object *obt, Object *ob)
        bMessageActuator *ma;
        bParentActuator *para;
        bArmatureActuator *aa;
+       bSteeringActuator *sta;
 
        sens= obt->sensors.first;
        while(sens) {
@@ -653,6 +662,11 @@ void sca_remove_ob_poin(Object *obt, Object *ob)
                        if (aa->target == ob) aa->target = NULL;
                        if (aa->subtarget == ob) aa->subtarget = NULL;
                        break;
+               case ACT_STEERING:
+                       sta = act->data;
+                       if (sta->target==ob) sta->target = NULL;
+                       if (sta->navmesh==ob) sta->navmesh = NULL;
+                       break;                  
                }
                act= act->next;
        }