BGE patch #17483 approved: object actuator DRot reverted since Blender 246.
[blender.git] / source / blender / blenloader / intern / readfile.c
index 7805f98f5d1be8667e82465763a8c20b9eafc23b..f24784217379e2201bce56701d1ce4b4b469963e 100644 (file)
@@ -7766,6 +7766,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        /* sun/sky */
        if(main->versionfile < 246) {
                Lamp *la;
+               Object *ob;
+               bActuator *act;
 
                for(la=main->lamp.first; la; la= la->id.next) {
                        la->sun_effect_type = 0;
@@ -7780,10 +7782,22 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        la->atm_distance_factor = 1.0;
                        la->sun_intensity = 1.0;
                }
+               /* dRot actuator change direction in 2.46 */
+               for(ob = main->object.first; ob; ob= ob->id.next) {
+                       for(act= ob->actuators.first; act; act= act->next) {
+                               if (act->type == ACT_OBJECT) {
+                                       bObjectActuator *ba= act->data;
+
+                                       ba->drot[0] = -ba->drot[0];
+                                       ba->drot[1] = -ba->drot[1];
+                                       ba->drot[2] = -ba->drot[2];
+                               }
+                       }
+               }
        }
        
        // convert fluids to modifier
-       if(main->versionfile <= 246 && main->subversionfile < 1)
+       if(main->versionfile < 246 || (main->versionfile == 246 && main->subversionfile < 1))
        {
                Object *ob;