mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Driveable vehicle update (by anv)
- Vehicles can now exit sector in tactical screen. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7216 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -4557,9 +4557,15 @@ UINT8 FindNextActiveAndAliveMerc( SOLDIERTYPE *pSoldier, BOOLEAN fGoodForLessOKL
|
||||
SOLDIERTYPE *FindNextActiveSquad( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
INT32 cnt, cnt2;
|
||||
|
||||
// anv: soldier's "assignment" can be a vehicle, not a proper squad, causing out-of-range in second loop
|
||||
INT8 bMaxSquad = pSoldier->bAssignment;
|
||||
if( bMaxSquad >= NUMBER_OF_SQUADS )
|
||||
{
|
||||
bMaxSquad = NUMBER_OF_SQUADS - 1;
|
||||
}
|
||||
|
||||
|
||||
for( cnt = pSoldier->bAssignment + 1 ; cnt < NUMBER_OF_SQUADS; cnt++ )
|
||||
for( cnt = bMaxSquad + 1 ; cnt < NUMBER_OF_SQUADS; cnt++ )
|
||||
{
|
||||
for( cnt2 =0; cnt2 < NUMBER_OF_SOLDIERS_PER_SQUAD; cnt2++ )
|
||||
{
|
||||
@@ -4572,7 +4578,7 @@ SOLDIERTYPE *FindNextActiveSquad( SOLDIERTYPE *pSoldier )
|
||||
|
||||
// none found,
|
||||
// Now loop back
|
||||
for( cnt = 0; cnt <= pSoldier->bAssignment; cnt++ )
|
||||
for( cnt = 0; cnt <= bMaxSquad; cnt++ )
|
||||
{
|
||||
for( cnt2 =0; cnt2 < NUMBER_OF_SOLDIERS_PER_SQUAD; cnt2++ )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user