diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-10 16:20:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-10 16:20:32 +0300 |
commit | 1f2fe7ec1409298527d757cb395358bc02d494c1 (patch) | |
tree | 34bc4365ef932ff5bb5db167640d80ff16af86d0 /source | |
parent | af2e6c38e99024d5055e66e2aea75de61c3280e9 (diff) |
fix for own error in active bone commit, wasnt checking object type was an armature
also fix for warning with printf
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/screen/screen_context.c | 22 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_ExpressionController.cpp | 2 |
2 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index c02d86a567e..31827e1b9c0 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -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; + } } } } diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.cpp b/source/gameengine/GameLogic/SCA_ExpressionController.cpp index 91135079fe6..2771b6c45b5 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.cpp +++ b/source/gameengine/GameLogic/SCA_ExpressionController.cpp @@ -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(); |