Game Development Community

t2dPath->setDirection in 1.3.x is broken now

by Darren Decker · in iTorque 2D · 04/06/2010 (6:31 am) · 1 replies

The change that was made to the t2dPath->setDirection in release 1.3.x makes it impossible to have your path objects change direction while traveling along the path. It broke my existing functionality in my game. You have to change it back to what release 1.2 had in order for it to work correctly.

1.2 Code:

void setDirection(t2dSceneObject* object, S32 direction, bool reset = true)
   {      
	  PathedObject* pathedObject = getPathedObject(object);  

	  if (pathedObject) { 
		  if ( reset ) {
		      pathedObject->setStartDirection(direction, reset);
		  } else {
			  pathedObject->setDirection(direction);
		  }
	  }
   }

1.3.1 Code:

void setDirection(t2dSceneObject* object, S32 direction, bool resetObject)
   {
      PathedObject* pathedObject = getPathedObject(object);
      if (pathedObject) pathedObject->setStartDirection(direction, resetObject);
   }