diff options
author | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-01-29 08:03:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-29 08:43:20 +0300 |
commit | 072d80a9de3adef632b8637649b169c4a895c1b9 (patch) | |
tree | f3b82fe2120242a5ce636e0fa298bb058649e960 /source/blender/makesrna/intern/rna_sensor.c | |
parent | 65574b0b030fd1a893520fe967e580ed00308cb5 (diff) |
Fix T42858: Non uniform gamelogic names on copy
Use generic function for consistent behavior
D949 by @lordloki
Diffstat (limited to 'source/blender/makesrna/intern/rna_sensor.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sensor.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c index 28b7b5fbcd8..5d7bb6d2d94 100644 --- a/source/blender/makesrna/intern/rna_sensor.c +++ b/source/blender/makesrna/intern/rna_sensor.c @@ -107,14 +107,10 @@ static StructRNA *rna_Sensor_refine(struct PointerRNA *ptr) static void rna_Sensor_name_set(PointerRNA *ptr, const char *value) { - bSensor *sens = (bSensor *)ptr->data; - + Object *ob = ptr->id.data; + bSensor *sens = ptr->data; BLI_strncpy_utf8(sens->name, value, sizeof(sens->name)); - - if (ptr->id.data) { - Object *ob = (Object *)ptr->id.data; - BLI_uniquename(&ob->sensors, sens, DATA_("Sensor"), '.', offsetof(bSensor, name), sizeof(sens->name)); - } + BLI_uniquename(&ob->sensors, sens, DATA_("Sensor"), '.', offsetof(bSensor, name), sizeof(sens->name)); } static void rna_Sensor_type_set(struct PointerRNA *ptr, int value) |