# Fixed walking on a multistep path, which sometimes stopped after the first few steps.
The problem was incorrect logic in the start-next-segment-of-the-path code that was added to allow multiple segments to be handled within the same update. I'm not sure how this worked before but it seemed to give continuous paths! Likely that's because the pathing for contact actions is different. Also added more sanity checks in Aura.cpp for deleted entities in the m_Influenced queue. There was a crash caused by something here though it's hard to reproduce. This was SVN commit r5597.
This commit is contained in:
parent
e4f3567d39
commit
455556783e
@ -431,7 +431,7 @@ bool AStarGoalLowLevel::IsAtGoal( const CVector2D &loc )
|
||||
{
|
||||
float dx = coord.x - loc.x;
|
||||
float dy = coord.y - loc.y;
|
||||
return dx*dx + dy*dy <= radius*radius;
|
||||
return dx*dx + dy*dy <= radius*radius / (CELL_SIZE*CELL_SIZE); // Scale down radius to tilespace
|
||||
}
|
||||
|
||||
float AStarGoalLowLevel::GetTileCost( const CVector2D& loc1, const CVector2D& loc2 )
|
||||
|
@ -33,7 +33,7 @@ void CAura::Update( size_t timestep )
|
||||
for( std::vector<HEntity>::iterator it = m_influenced.begin(); it != m_influenced.end(); it++ )
|
||||
{
|
||||
CEntity* ent = *it;
|
||||
if( ent->m_extant )
|
||||
if( ent && ent->m_extant )
|
||||
{
|
||||
prevInfluenced.push_back(ent);
|
||||
}
|
||||
@ -124,7 +124,7 @@ void CAura::RemoveAll()
|
||||
for( std::vector<HEntity>::iterator it = m_influenced.begin(); it != m_influenced.end(); it++ )
|
||||
{
|
||||
CEntity* ent = *it;
|
||||
if( ent->m_extant )
|
||||
if( ent && ent->m_extant )
|
||||
{
|
||||
argv[0] = OBJECT_TO_JSVAL( ent->GetScript() );
|
||||
JS_CallFunctionValue( m_cx, m_handler, exitFunction, 1, argv, &rval );
|
||||
|
@ -287,7 +287,7 @@ bool CEntity::ProcessGotoNoPathing( CEntityOrder* current, size_t timestep_milli
|
||||
case CEntityOrder::ORDER_GOTO_COLLISION:
|
||||
case CEntityOrder::ORDER_GOTO_SMOOTHED:
|
||||
size_t newTimestep = cpu_i32FromFloat(timeLeft * 1000.0f);
|
||||
return( ProcessGotoNoPathing( current, newTimestep ) );
|
||||
return( ProcessGotoNoPathing( newOrder, newTimestep ) );
|
||||
}
|
||||
}
|
||||
return( false );
|
||||
@ -366,7 +366,9 @@ bool CEntity::ProcessGotoNoPathing( CEntityOrder* current, size_t timestep_milli
|
||||
return( false );
|
||||
}
|
||||
case STANCE_DISALLOWS:
|
||||
{
|
||||
return( false ); // The stance will have cleared our order queue already
|
||||
}
|
||||
default:
|
||||
return( false );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user