mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Simplified ImprovedAutoFastForward feature (allows to accelerate only invisible enemies) (by sevenfm)
Now single option IMPROVED_AUTO_FAST_FORWARD=TRUE by default Removed options: AUTO_FAST_FORWARD_ENEMIES AUTO_FAST_FORWARD_MILITIA AUTO_FAST_FORWARD_CIVS AUTO_FAST_FORWARD_CREATURES ENEMY_CLOCK_SPEED_PERCENT Also a small fix (additional update of AutoFastForward status when soldier arrives at new gridno) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7828 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -152,6 +152,8 @@ class SOLDIERTYPE;
|
||||
|
||||
extern void HandleBestSightingPositionInRealtime();
|
||||
|
||||
void UpdateFastForwardMode( SOLDIERTYPE* pSoldier ); // sevenfm: to call in HandleAtNewGridNo
|
||||
|
||||
extern UINT8 gubAICounter;
|
||||
|
||||
#include "fresh_header.h"
|
||||
@@ -2770,6 +2772,9 @@ BOOLEAN HandleAtNewGridNo( SOLDIERTYPE *pSoldier, BOOLEAN *pfKeepMoving )
|
||||
}
|
||||
}
|
||||
|
||||
// sevenfm: additional check for auto fast forwarding
|
||||
UpdateFastForwardMode( pSoldier );
|
||||
|
||||
// ATE: Put some stuff in here to not handle certain things if we are
|
||||
// trversing...
|
||||
if ( gubWaitingForAllMercsToExitCode == WAIT_FOR_MERCS_TO_WALKOFF_SCREEN || gubWaitingForAllMercsToExitCode == WAIT_FOR_MERCS_TO_WALK_TO_GRIDNO )
|
||||
@@ -11077,6 +11082,45 @@ BOOLEAN GetRandomUnknownVIPSector( UINT16& aSector )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void UpdateFastForwardMode( SOLDIERTYPE* pSoldier )
|
||||
{
|
||||
BOOLEAN action = FALSE;
|
||||
BOOLEAN forward = FALSE;
|
||||
|
||||
if( gGameExternalOptions.fImprovedAutoFastForward == FALSE ||
|
||||
!gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] ||
|
||||
is_networked ||
|
||||
!( gTacticalStatus.uiFlags & TURNBASED && gTacticalStatus.uiFlags & INCOMBAT ) ||
|
||||
pSoldier->bTeam == OUR_TEAM )
|
||||
return;
|
||||
|
||||
switch ( pSoldier->aiData.bAction )
|
||||
{
|
||||
case AI_ACTION_TOSS_PROJECTILE:
|
||||
case AI_ACTION_KNIFE_MOVE:
|
||||
case AI_ACTION_FIRE_GUN:
|
||||
case AI_ACTION_THROW_KNIFE:
|
||||
case AI_ACTION_PULL_TRIGGER:
|
||||
case AI_ACTION_USE_DETONATOR:
|
||||
case AI_ACTION_OPEN_OR_CLOSE_DOOR:
|
||||
case AI_ACTION_LOWER_GUN:
|
||||
case AI_ACTION_RAISE_GUN:
|
||||
case AI_ACTION_CLIMB_ROOF:
|
||||
case AI_ACTION_STEAL_MOVE:
|
||||
case AI_ACTION_JUMP_WINDOW:
|
||||
case AI_ACTION_USE_SKILL:
|
||||
action = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
// accelerate only invisible soldiers that are not doing specific actions like shooting
|
||||
if( pSoldier->bVisible == -1 )
|
||||
forward = !action;
|
||||
|
||||
if ( IsFastForwardMode() != forward )
|
||||
SetFastForwardMode( forward );
|
||||
}
|
||||
|
||||
void DeleteVIP( INT16 sMapX, INT16 sMapY )
|
||||
{
|
||||
if ( StrategicMap[SECTOR( sMapX, sMapY )].usFlags & ENEMY_VIP_PRESENT_KNOWN )
|
||||
|
||||
Reference in New Issue
Block a user