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:
authorMitchell Stokes <mogurijin@gmail.com>2011-02-22 02:44:11 +0300
committerMitchell Stokes <mogurijin@gmail.com>2011-02-22 02:44:11 +0300
commitb5e3d2a2eaec5ac20c959538a9c161b25e2087a7 (patch)
tree81e76be8139715babb12f487ad35772844b386aa /source/gameengine
parent648dec3411a526eba9ac3ae2501038028ece4bc7 (diff)
Bugfix #25803 (LibLoad'ed scene objects don't have timer property updated)
The KX_Scenes' SCA_TimeEventManagers were not being merged. These handle the timer prop
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/GameLogic/SCA_TimeEventManager.cpp6
-rw-r--r--source/gameengine/GameLogic/SCA_TimeEventManager.h1
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp10
3 files changed, 17 insertions, 0 deletions
diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.cpp b/source/gameengine/GameLogic/SCA_TimeEventManager.cpp
index 8b99fd669a9..ac4aa7eba6d 100644
--- a/source/gameengine/GameLogic/SCA_TimeEventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_TimeEventManager.cpp
@@ -109,3 +109,9 @@ void SCA_TimeEventManager::RemoveTimeProperty(CValue* timeval)
}
}
}
+
+vector<CValue*> SCA_TimeEventManager::GetTimeValues()
+{
+ return m_timevalues;
+}
+
diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.h b/source/gameengine/GameLogic/SCA_TimeEventManager.h
index b2a2eb5fe5d..a3aa994ea37 100644
--- a/source/gameengine/GameLogic/SCA_TimeEventManager.h
+++ b/source/gameengine/GameLogic/SCA_TimeEventManager.h
@@ -49,6 +49,7 @@ public:
void AddTimeProperty(CValue* timeval);
void RemoveTimeProperty(CValue* timeval);
+ vector<CValue*> GetTimeValues();
#ifdef WITH_CXX_GUARDEDALLOC
public:
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 87cb46e65a9..721d2013e05 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1857,6 +1857,16 @@ bool KX_Scene::MergeScene(KX_Scene *other)
/* when merging objects sensors are moved across into the new manager, dont need to do this here */
}
+
+ /* grab any timer properties from the other scene */
+ SCA_TimeEventManager *timemgr= GetTimeEventManager();
+ SCA_TimeEventManager *timemgr_other= other->GetTimeEventManager();
+ vector<CValue*> times = timemgr_other->GetTimeValues();
+
+ for(unsigned int i= 0; i < times.size(); i++) {
+ timemgr->AddTimeProperty(times[i]);
+ }
+
}
return true;
}