mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
- Added AndroidXP fixes for Sniper Deadlock and Grenade AP loss
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@797 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+25
-11
@@ -1142,7 +1142,7 @@ void ActionDone(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
#ifdef TESTAI
|
||||
DebugMsg( TOPIC_JA2AI, DBG_LEVEL_3,
|
||||
String("Cancelling actiondone: our action %d, desdir %d dir %d",pSoldier->bAction,pSoldier->bDesiredDirection,pSoldier->bDirection) );
|
||||
String("Cancelling actiondone: our action %d, desdir %d dir %d",pSoldier->bAction,pSoldier->bDesiredDirection,pSoldier->bDirection) );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1157,23 +1157,30 @@ void ActionDone(SOLDIERTYPE *pSoldier)
|
||||
// cancel any turning & movement by making current settings desired ones
|
||||
pSoldier->sFinalDestination = pSoldier->sGridNo;
|
||||
|
||||
if ( !pSoldier->fNoAPToFinishMove )
|
||||
{
|
||||
EVENT_StopMerc( pSoldier, pSoldier->sGridNo, pSoldier->bDirection );
|
||||
AdjustNoAPToFinishMove( pSoldier, FALSE );
|
||||
}
|
||||
if ( !pSoldier->fNoAPToFinishMove )
|
||||
{
|
||||
EVENT_StopMerc( pSoldier, pSoldier->sGridNo, pSoldier->bDirection );
|
||||
AdjustNoAPToFinishMove( pSoldier, FALSE );
|
||||
}
|
||||
|
||||
//Lalien: moved later in ExecuteAction() case AI_ACTION_RAISE_GUN:
|
||||
//AXP 23.03.2007: Sniper deadlock fix
|
||||
//if ( pSoldier->bOrders == SNIPER && pSoldier->bAction == AI_ACTION_RAISE_GUN && pSoldier->bLastAction == AI_ACTION_RAISE_GUN)
|
||||
//{
|
||||
// pSoldier->bNextAction = AI_ACTION_END_TURN;
|
||||
//}
|
||||
|
||||
// cancel current action
|
||||
pSoldier->bLastAction = pSoldier->bAction;
|
||||
pSoldier->bAction = AI_ACTION_NONE;
|
||||
pSoldier->usActionData = NOWHERE;
|
||||
pSoldier->bLastAction = pSoldier->bAction;
|
||||
pSoldier->bAction = AI_ACTION_NONE;
|
||||
pSoldier->usActionData = NOWHERE;
|
||||
pSoldier->bActionInProgress = FALSE;
|
||||
pSoldier->fDelayedMovement = FALSE;
|
||||
|
||||
/*
|
||||
/*
|
||||
if ( pSoldier->bLastAction == AI_ACTION_CHANGE_STANCE || pSoldier->bLastAction == AI_ACTION_COWER || pSoldier->bLastAction == AI_ACTION_STOP_COWERING )
|
||||
{
|
||||
SoldierGotoStationaryStance( pSoldier );
|
||||
SoldierGotoStationaryStance( pSoldier );
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -2561,6 +2568,13 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
|
||||
case AI_ACTION_RAISE_GUN: //Madd: action added for snipers to ready weapon and use vision range bonuses
|
||||
SoldierReadyWeapon(pSoldier);
|
||||
HandleSight(pSoldier, SIGHT_LOOK | SIGHT_RADIO);
|
||||
|
||||
//AXP 23.03.2007: Sniper deadlock fix
|
||||
if ( pSoldier->bOrders == SNIPER && pSoldier->bLastAction == AI_ACTION_RAISE_GUN)
|
||||
{
|
||||
pSoldier->bNextAction = AI_ACTION_END_TURN;
|
||||
}
|
||||
|
||||
ActionDone( pSoldier );
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user