From b8572527dfe3d7c1372d1c050bbd02550439dc0b Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 26 Nov 2010 03:58:31 +0000 Subject: follow up of "Bugfix #23576" (Logic UI) - replacing hardcoded values by RNA_struct_is_a + making rna_sensor future proof --- source/blender/makesrna/intern/rna_actuator.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/blender/makesrna/intern/rna_actuator.c') diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index fa5397e669e..2fa93bcecdd 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -25,6 +25,7 @@ #include #include "RNA_define.h" +#include "RNA_access.h" #include "rna_internal.h" #include "DNA_constraint_types.h" @@ -360,9 +361,7 @@ EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, int *fre Object *ob= NULL; int totitem= 0; - /* hardcoded exceptions, for these cases code below needs to find the id.data */ - /* otherwise buttons never give all options for selected */ - if (ptr->type==&RNA_Actuator || ptr->type==&RNA_ArmatureActuator || ptr->type==&RNA_ShapeActionActuator) { + if (ptr->type==&RNA_Actuator || RNA_struct_is_a(ptr->type, &RNA_Actuator)){ ob = (Object *)ptr->id.data; } else { /* can't use ob from ptr->id.data because that enum is also used by operators */ -- cgit v1.2.3