Bugfix for JaggZilla bug #515

When we fly to a sector with enemies and assign at least one of our passengers in the heli to a squad the game will remove everyone from the heli and start combat. This prevents the exploits that existed before where we could assign our men to anything in hostile sectors.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6486 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2013-10-13 18:10:51 +00:00
parent 9602a67946
commit 90dabd20ad
3 changed files with 32 additions and 17 deletions
+5 -4
View File
@@ -985,22 +985,23 @@ void SetUpHelicopterForPlayer( INT16 sX, INT16 sY , UINT8 SkyDrive, UINT8 Vehicl
}
UINT8 MoveAllInHelicopterToFootMovementGroup( void )
UINT8 MoveAllInHelicopterToFootMovementGroup( INT8 bNewSquad )
{
// take everyone out of heli and add to movement group
INT32 iCounter = 0;
UINT8 ubGroupId = 0;
SOLDIERTYPE *pSoldier;
INT8 bNewSquad;
//INT8 bNewSquad;
BOOLEAN fAnyoneAboard = FALSE;
BOOLEAN fSuccess;
UINT8 ubInsertionCode = 0;
BOOLEAN fInsertionCodeSet = FALSE;
UINT16 usInsertionData = 0;
// put these guys on their own squad (we need to return their group ID, and can only return one, so they need a unique one
bNewSquad = GetFirstEmptySquad();
// silversurfer: This function now accepts a preferred squad ID as parameter. If this squad is empty we will use it instead of the first empty squad.
if ( !SquadIsEmpty( bNewSquad ) )
bNewSquad = GetFirstEmptySquad();
if ( bNewSquad == -1 )
{
return( 0 );