Work has begun to enable strategic movement for other teams than just player and enemy.

- I've changed the GROUP struct - instead of BOOLEAN fPlayer we now have UINT8 usGroupTeam.
- To further simplify the code, I've replaced 
UINT8 NumEnemiesInSector( INT16 sSectorX, INT16 sSectorY ); 
with 
UINT8 NumNonPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubTeam );

In the next days, more strategic functions will be simplified, merged and replaced.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7707 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2015-01-06 00:50:25 +00:00
parent 57f6e41d47
commit c8eda14e2b
23 changed files with 353 additions and 299 deletions
+4 -4
View File
@@ -210,7 +210,7 @@ INT32 FindStratPath(INT16 sStart, INT16 sDestination, INT16 sMvtGroupNumber, BOO
// for player groups only!
pGroup = GetGroup( ( UINT8 )sMvtGroupNumber );
if ( pGroup->fPlayer )
if ( pGroup->usGroupTeam == OUR_TEAM )
{
// if player is holding down SHIFT key, find the shortest route instead of the quickest route!
if ( _KeyDown( SHIFT ) )
@@ -1569,7 +1569,7 @@ void RebuildWayPointsForGroupPath( PathStPtr pHeadOfPath, INT16 sMvtGroup )
RemoveGroupWaypoints( ( UINT8 )sMvtGroup );
if( pGroup->fPlayer )
if ( pGroup->usGroupTeam == OUR_TEAM )
{
#ifdef BETA_VERSION
VerifyAllMercsInGroupAreOnSameSquad( pGroup );
@@ -1592,7 +1592,7 @@ void RebuildWayPointsForGroupPath( PathStPtr pHeadOfPath, INT16 sMvtGroup )
{
// and it's a player group, and it's between sectors
// NOTE: AI groups never reverse direction between sectors, Kris cheats & teleports them back to their current sector!
if( pGroup->fPlayer && pGroup->fBetweenSectors )
if ( pGroup->usGroupTeam == OUR_TEAM && pGroup->fBetweenSectors )
{
// send the group right back to its current sector by reversing directions
GroupReversingDirectionsBetweenSectors( pGroup, pGroup->ubSectorX, pGroup->ubSectorY, FALSE );
@@ -1916,7 +1916,7 @@ PathStPtr GetGroupMercPathPtr( GROUP *pGroup )
Assert( pGroup );
// must be a player group!
Assert( pGroup->fPlayer );
Assert( pGroup->usGroupTeam == OUR_TEAM );
if( pGroup->fVehicle )
{