fix for gibberish text in 2DFilter actuator when text unlinked through the Text Editor

(reported nowhere, I found this while testing osl custom node)
This commit is contained in:
Dalai Felinto 2012-09-25 05:48:33 +00:00
parent b3fd195665
commit f2064367a3

@ -48,6 +48,7 @@
#include "DNA_constraint_types.h"
#include "DNA_controller_types.h"
#include "DNA_actuator_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
@ -528,6 +529,7 @@ void BKE_text_unlink(Main *bmain, Text *text)
SpaceLink *sl;
Object *ob;
bController *cont;
bActuator *act;
bConstraint *con;
short update;
@ -541,6 +543,15 @@ void BKE_text_unlink(Main *bmain, Text *text)
if (pc->text == text) pc->text = NULL;
}
}
/* game actuators */
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_2DFILTER) {
bTwoDFilterActuator *tfa;
tfa = act->data;
if (tfa->text == text) tfa->text = NULL;
}
}
/* pyconstraints */
update = 0;