Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/BKE_blender.h2
-rw-r--r--source/blender/blenloader/intern/readfile.c22
-rw-r--r--source/blender/src/buttons_logic.c14
-rw-r--r--source/gameengine/Converter/KX_ConvertActuators.cpp12
4 files changed, 31 insertions, 19 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 0105587c5b4..421b4300c8a 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -41,7 +41,7 @@ struct ListBase;
struct MemFile;
#define BLENDER_VERSION 247
-#define BLENDER_SUBVERSION 9
+#define BLENDER_SUBVERSION 10
#define BLENDER_MINVERSION 245
#define BLENDER_MINSUBVERSION 15
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 5b4fd470e6e..25f9e179ca9 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7926,9 +7926,27 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
la->sky_exposure= 1.0f;
}
}
+
+ /* BGE message actuators needed OB prefix, very confusing */
+ if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 10)) {
+ bActuator *act;
+ Object *ob;
-
-
+ for(ob = main->object.first; ob; ob= ob->id.next) {
+ for(act= ob->actuators.first; act; act= act->next) {
+ if (act->type == ACT_MESSAGE) {
+ bMessageActuator *msgAct = (bMessageActuator *) act->data;
+ if (strlen(msgAct->toPropName) > 2) {
+ /* strip first 2 chars, would have only worked if these were OB anyway */
+ strncpy(msgAct->toPropName, msgAct->toPropName+2, sizeof(msgAct->toPropName));
+ } else {
+ msgAct->toPropName[0] = '\0';
+ }
+ }
+ }
+ }
+ }
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */
diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c
index a54f20b85c2..5a8c731c25e 100644
--- a/source/blender/src/buttons_logic.c
+++ b/source/blender/src/buttons_logic.c
@@ -2565,29 +2565,19 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
case ACT_MESSAGE:
ma = act->data;
-#define MESSAGE_SENSOR_TO_FIELD_WORKS /* Really? Not really. Don't remove this ifdef yet */
-
-#ifdef MESSAGE_SENSOR_TO_FIELD_WORKS
ysize = 4 + (3 * 24); /* footer + number of lines * 24 pixels/line */
-#else
- ysize = 4 + (2 * 24); /* footer + number of lines * 24 pixels/line */
-#endif
+
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize,
(float)xco+width, (float)yco, 1);
myline=1;
-
-#ifdef MESSAGE_SENSOR_TO_FIELD_WORKS
/* line 1: To */
uiDefBut(block, TEX, 1, "To: ",
(xco+10), (yco-(myline++*24)), (width-20), 19,
&ma->toPropName, 0, 31, 0, 0,
- "Optional send message to objects with this name only (Prefix name with OB)"
- ", or empty to broadcast");
-
-#endif
+ "Optional send message to objects with this name only, or empty to broadcast");
/* line 2: Message Subject */
uiDefBut(block, TEX, 1, "Subject: ",
diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp
index d5f304c38e7..4f152acc918 100644
--- a/source/gameengine/Converter/KX_ConvertActuators.cpp
+++ b/source/gameengine/Converter/KX_ConvertActuators.cpp
@@ -291,15 +291,19 @@ void BL_ConvertActuators(char* maggiename,
STR_String toPropName = (msgAct->toPropName
? (char*) msgAct->toPropName
: "");
- /**
- * Get the Message Subject to send.
+ /* BGE Wants "OB" prefix */
+ if (toPropName != "")
+ toPropName = "OB" + toPropName;
+
+ /**
+ * Get the Message Subject to send.
*/
STR_String subject = (msgAct->subject
? (char*) msgAct->subject
: "");
- /**
- * Get the bodyType
+ /**
+ * Get the bodyType
*/
int bodyType = msgAct->bodyType;