- Tactical militia command: stopped merc from moving to militia in combat if he doesn't have a headset (radio)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@736 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2007-02-24 10:13:46 +00:00
parent 035e6d5caa
commit b0ef70dbb8
3 changed files with 43 additions and 36 deletions
+40 -33
View File
@@ -5713,45 +5713,52 @@ BOOLEAN HandleTalkInit( )
if ( ( uiRange > commandRange ) && ( !CheckIfRadioIsEquipped() ) ) //lal
{
// First get an adjacent gridno....
sActionGridNo = FindAdjacentGridEx( pSoldier, pTSoldier->sGridNo, &ubDirection, NULL, FALSE, TRUE );
if ( sActionGridNo == -1 )
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, TacticalStr[ NO_PATH ] );
return( FALSE );
}
if ( UIPlotPath( pSoldier, sActionGridNo, NO_COPYROUTE, FALSE, TEMPORARY, (UINT16)pSoldier->usUIMovementMode, NOT_STEALTH, FORWARD, pSoldier->bActionPoints ) == 0 )
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, TacticalStr[ NO_PATH ] );
return( FALSE );
}
// Walk up and talk to buddy....
gfNPCCircularDistLimit = TRUE;
sGoodGridNo = FindGridNoFromSweetSpotWithStructData( pSoldier, pSoldier->usUIMovementMode, pTSoldier->sGridNo, (NPC_TALK_RADIUS-1), &ubNewDirection, TRUE );
gfNPCCircularDistLimit = FALSE;
// First calculate APs and validate...
sAPCost = AP_TALK;
//sAPCost += UIPlotPath( pSoldier, sGoodGridNo, NO_COPYROUTE, FALSE, TEMPORARY, (UINT16)pSoldier->usUIMovementMode, NOT_STEALTH, FORWARD, pSoldier->bActionPoints );
// Check AP cost...
if ( !EnoughPoints( pSoldier, sAPCost, 0, TRUE ) )
if( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) )
{
return( FALSE );
}
else
{
// First get an adjacent gridno....
sActionGridNo = FindAdjacentGridEx( pSoldier, pTSoldier->sGridNo, &ubDirection, NULL, FALSE, TRUE );
// Now walkup to talk....
pSoldier->ubPendingAction = MERC_TALK;
pSoldier->uiPendingActionData1 = pTSoldier->ubID;
pSoldier->ubPendingActionAnimCount = 0;
if ( sActionGridNo == -1 )
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, TacticalStr[ NO_PATH ] );
return( FALSE );
}
// WALK UP TO DEST FIRST
EVENT_InternalGetNewSoldierPath( pSoldier, sGoodGridNo, pSoldier->usUIMovementMode , TRUE , pSoldier->fNoAPToFinishMove );
if ( UIPlotPath( pSoldier, sActionGridNo, NO_COPYROUTE, FALSE, TEMPORARY, (UINT16)pSoldier->usUIMovementMode, NOT_STEALTH, FORWARD, pSoldier->bActionPoints ) == 0 )
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, TacticalStr[ NO_PATH ] );
return( FALSE );
}
return( FALSE );
// Walk up and talk to buddy....
gfNPCCircularDistLimit = TRUE;
sGoodGridNo = FindGridNoFromSweetSpotWithStructData( pSoldier, pSoldier->usUIMovementMode, pTSoldier->sGridNo, (NPC_TALK_RADIUS-1), &ubNewDirection, TRUE );
gfNPCCircularDistLimit = FALSE;
// First calculate APs and validate...
sAPCost = AP_TALK;
//sAPCost += UIPlotPath( pSoldier, sGoodGridNo, NO_COPYROUTE, FALSE, TEMPORARY, (UINT16)pSoldier->usUIMovementMode, NOT_STEALTH, FORWARD, pSoldier->bActionPoints );
// Check AP cost...
if ( !EnoughPoints( pSoldier, sAPCost, 0, TRUE ) )
{
return( FALSE );
}
// Now walkup to talk....
pSoldier->ubPendingAction = MERC_TALK;
pSoldier->uiPendingActionData1 = pTSoldier->ubID;
pSoldier->ubPendingActionAnimCount = 0;
// WALK UP TO DEST FIRST
EVENT_InternalGetNewSoldierPath( pSoldier, sGoodGridNo, pSoldier->usUIMovementMode , TRUE , pSoldier->fNoAPToFinishMove );
return( FALSE );
}
}
else
{