mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Fix for clock problem when dual wield or auto-fire causes a soldier to turn on the first shot but knocks him down on a successive shot
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1542 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -7724,7 +7724,12 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( )
|
|||||||
if ( pSoldier )
|
if ( pSoldier )
|
||||||
{
|
{
|
||||||
pSoldier->bNumPelletsHitBy = 0;
|
pSoldier->bNumPelletsHitBy = 0;
|
||||||
pSoldier->fGettingHit = FALSE;
|
if ( !( pSoldier->uiStatusFlags & SOLDIER_TURNINGFROMHIT ) )
|
||||||
|
{
|
||||||
|
// 0verhaul: This is an ugly hack. I don't like it, but until I figure out a better solution
|
||||||
|
// for turning from a hit, it's the only way to not stop a soldier in mid-turn.
|
||||||
|
pSoldier->fGettingHit = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (pSoldier->ubAttackerID != NOBODY )
|
if (pSoldier->ubAttackerID != NOBODY )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1396,8 +1396,14 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
|
|||||||
// OK, pick a larger direction to goto....
|
// OK, pick a larger direction to goto....
|
||||||
pSoldier->uiStatusFlags |= SOLDIER_TURNINGFROMHIT;
|
pSoldier->uiStatusFlags |= SOLDIER_TURNINGFROMHIT;
|
||||||
// This becomes an attack busy situation
|
// This becomes an attack busy situation
|
||||||
gTacticalStatus.ubAttackBusyCount++;
|
// 0verhaul: There is an attack busy problem with this. The soldier could be in mid-turn
|
||||||
DebugAttackBusy( String( "Soldier turning from a hit. Increasing attack busy. Now %d\n", gTacticalStatus.ubAttackBusyCount ) );
|
// when another bullet is fired (auto-fire or dual-wield, for instance), and the soldier is
|
||||||
|
// knocked down in the middle of the turn. In such a case, the attack busy does not get
|
||||||
|
// cancelled. So if we indeed need to keep the attack busy (which may not be the case),
|
||||||
|
// we will need to find a more reliable method. For now, I'm going to cancel out the
|
||||||
|
// ABC adjustment here and we'll see if there needs to be something in its place.
|
||||||
|
//gTacticalStatus.ubAttackBusyCount++;
|
||||||
|
DebugAttackBusy( String( "Soldier turning from a hit. Not Increasing attack busy. Now %d\n", gTacticalStatus.ubAttackBusyCount ) );
|
||||||
|
|
||||||
// Pick evenly between both
|
// Pick evenly between both
|
||||||
if ( Random( 50 ) < 25 )
|
if ( Random( 50 ) < 25 )
|
||||||
|
|||||||
@@ -6095,8 +6095,9 @@ void TurnSoldier( SOLDIERTYPE *pSoldier)
|
|||||||
// Release attacker
|
// Release attacker
|
||||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Releasesoldierattacker, turning from hit animation ended") );
|
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Releasesoldierattacker, turning from hit animation ended") );
|
||||||
// ReleaseSoldiersAttacker( pSoldier );
|
// ReleaseSoldiersAttacker( pSoldier );
|
||||||
DebugAttackBusy( "Finished turning from hit. Reducing attack busy.\n");
|
// 0verhaul: Since I disabled the turn from hit ABC increase, I need to disable the turn from hit decrease too.
|
||||||
ReduceAttackBusyCount( );
|
DebugAttackBusy( "Finished turning from hit. Not Reducing attack busy.\n");
|
||||||
|
//ReduceAttackBusyCount( );
|
||||||
|
|
||||||
//FREEUP GETTING HIT FLAG
|
//FREEUP GETTING HIT FLAG
|
||||||
// pSoldier->fGettingHit = FALSE;
|
// pSoldier->fGettingHit = FALSE;
|
||||||
|
|||||||
Reference in New Issue
Block a user