Game Development Community

dev|Pro Game Development Curriculum

TGE crash when changing mounted object playing thread

by Nicolas Buquet · 02/22/2008 (10:58 am) · 4 comments

in shapeBase.cc :

in function ShapeBase::setThreadSequence(around line 2060)

if (mShapeInstance) {
        if (!st.thread)
            st.thread = mShapeInstance->addThread();
[b]
#ifdef __NB__MOUNTEDOBJECT_THREADCHRASH_PREVENT

			if(st.thread)
			{
			   mShapeInstance->setSequence(st.thread,seq,0);
                           stopThreadSound(st);
                           updateThread(st);
		    }

#else
[/b]
		 mShapeInstance->setSequence(st.thread,seq,0);
                 stopThreadSound(st);
                 updateThread(st);
[b]
#endif
[/b]
      }

And in the following function ShapeBase::updateThread

void ShapeBase::updateThread(Thread& st)
{
[b]
#ifdef __NB__MOUNTEDOBJECT_THREADCHRASH_PREVENT

   if(!st.thread) return;

#endif
[/b]
   switch (st.state) {
      case Thread::Stop:
            ...

#1
01/18/2008 (7:23 am)
And forget of course to add :

#define __NB__MOUNTEDOBJECT_THREADCHRASH_PREVENT

in TorqueConfig.h to activate the patch.
#2
05/16/2011 (3:48 am)
Thanks for posting this Nicolas!

According to bank, this is still an issue in T3D. Logged as THREED-1858 for investigation.
#3
05/16/2011 (4:17 am)
3 years old thread gets revisited!

Nothing is lost here.

I'm impatiently waiting for 1.1 final.

Nicolas Buquet
www.buquet-net.com/cv/