changeset 204:5816ab527da8

Fix for broken unit test.
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 14 Mar 2009 12:03:56 +0000
parents 44919eb74c40
children 54bfd1015b35
files engine/core/model/metamodel/timeprovider.h engine/core/model/structures/instance.cpp
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/engine/core/model/metamodel/timeprovider.h	Sat Mar 14 02:42:49 2009 +0000
+++ b/engine/core/model/metamodel/timeprovider.h	Sat Mar 14 12:03:56 2009 +0000
@@ -43,7 +43,7 @@
 		/** Constructor
 		 * In case there there is no provider master, you can use NULL
 		 */
-		TimeProvider(TimeProvider* master);
+		explicit TimeProvider(TimeProvider* master);
 		~TimeProvider();
 		
 		/** With multiplier, you can adjust the time speed. 0.5 means time runs half as slow,
--- a/engine/core/model/structures/instance.cpp	Sat Mar 14 02:42:49 2009 +0000
+++ b/engine/core/model/structures/instance.cpp	Sat Mar 14 12:03:56 2009 +0000
@@ -369,7 +369,10 @@
 				}
 			}
 
-			m_activity->m_actioninfo->m_prev_call_time = m_activity->m_timeprovider->getGameTime();
+			// previous code may invalidate actioninfo.
+			if( m_activity->m_actioninfo ) {
+				m_activity->m_actioninfo->m_prev_call_time = m_activity->m_timeprovider->getGameTime();
+			}
 		}
 		if (m_activity->m_sayinfo) {
 			if (m_activity->m_sayinfo->m_duration > 0) {