fix for own error in active bone commit, wasnt checking object type was an armature
authorCampbell Barton <ideasman42@gmail.com>
Tue, 10 Nov 2009 13:20:32 +0000 (13:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 10 Nov 2009 13:20:32 +0000 (13:20 +0000)
also fix for warning with printf

source/blender/editors/screen/screen_context.c
source/gameengine/GameLogic/SCA_ExpressionController.cpp

index c02d86a567e11db2b926cd467e968d4fe51ac5d3..31827e1b9c00cc9e527d1bd109ed471617b00765 100644 (file)
@@ -224,17 +224,19 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
                }
        }
        else if(CTX_data_equals(member, "active_bone")) {
-               bArmature *arm= (obact) ? obact->data : NULL;
-               if(arm->edbo) {
-                       if(arm->act_edbone) {
-                               CTX_data_pointer_set(result, &arm->id, &RNA_EditBone, arm->act_edbone);
-                               return 1;
+               if(obact && obact->type == OB_ARMATURE) {
+                       bArmature *arm= obact->data;
+                       if(arm->edbo) {
+                               if(arm->act_edbone) {
+                                       CTX_data_pointer_set(result, &arm->id, &RNA_EditBone, arm->act_edbone);
+                                       return 1;
+                               }
                        }
-               }
-               else {
-                       if(arm->act_bone) {
-                               CTX_data_pointer_set(result, &arm->id, &RNA_Bone, arm->act_bone);
-                               return 1;
+                       else {
+                               if(arm->act_bone) {
+                                       CTX_data_pointer_set(result, &arm->id, &RNA_Bone, arm->act_bone);
+                                       return 1;
+                               }
                        }
                }
        }
index 91135079fe616a30bcc1c56301a247d170de7271..2771b6c45b53d69da54587f8de78e42bc468fc1f 100644 (file)
@@ -107,7 +107,7 @@ void SCA_ExpressionController::Trigger(SCA_LogicManager* logicmgr)
                {
                        if (value->IsError())
                        {
-                               printf(value->GetText());
+                               printf("%s\n", value->GetText().ReadPtr());
                        } else
                        {
                                float num = (float)value->GetNumber();