mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
If an enemy group pursuits a player group that just retreated, make sure they don't arrive before or at the same time as the player group.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7907 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -4771,16 +4771,19 @@ void ResetMovementForNonPlayerGroup( GROUP *pGroup )
|
|||||||
MoveSAIGroupToSector( &pGroup, (UINT8)SECTOR( pOtherGroup->ubNextX, pOtherGroup->ubNextY ), DIRECT, PURSUIT );
|
MoveSAIGroupToSector( &pGroup, (UINT8)SECTOR( pOtherGroup->ubNextX, pOtherGroup->ubNextY ), DIRECT, PURSUIT );
|
||||||
|
|
||||||
// the group has to be delayed - otherwise they could arrive at the same time as the player, resulting in odd behaviour during insertion
|
// the group has to be delayed - otherwise they could arrive at the same time as the player, resulting in odd behaviour during insertion
|
||||||
DeleteStrategicEvent( EVENT_GROUP_ARRIVAL, pGroup->ubGroupID );
|
if ( pGroup->uiArrivalTime < min( pGroup->uiArrivalTime, pOtherGroup->uiArrivalTime ) + 5 )
|
||||||
|
|
||||||
// NOTE: This can cause the arrival time to be > GetWorldTotalMin() + TraverseTime, so keep that in mind
|
|
||||||
// if you have any code that uses these 3 values to figure out how far along its route a group is!
|
|
||||||
SetGroupArrivalTime( pGroup, pOtherGroup->uiArrivalTime + 5 );
|
|
||||||
|
|
||||||
if ( !AddStrategicEvent( EVENT_GROUP_ARRIVAL, pGroup->uiArrivalTime, pGroup->ubGroupID ) )
|
|
||||||
{
|
{
|
||||||
AssertMsg( 0, "Failed to add movement event." );
|
DeleteStrategicEvent( EVENT_GROUP_ARRIVAL, pGroup->ubGroupID );
|
||||||
break;
|
|
||||||
|
// NOTE: This can cause the arrival time to be > GetWorldTotalMin() + TraverseTime, so keep that in mind
|
||||||
|
// if you have any code that uses these 3 values to figure out how far along its route a group is!
|
||||||
|
SetGroupArrivalTime( pGroup, pOtherGroup->uiArrivalTime + 5 );
|
||||||
|
|
||||||
|
if ( !AddStrategicEvent( EVENT_GROUP_ARRIVAL, pGroup->uiArrivalTime, pGroup->ubGroupID ) )
|
||||||
|
{
|
||||||
|
AssertMsg( 0, "Failed to add movement event." );
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sucess = TRUE;
|
sucess = TRUE;
|
||||||
|
|||||||
Reference in New Issue
Block a user