nuke all the #if 0's

scripted commit:

find . -not -path '*/.*' -and -not -path '*/ext*' -type d -exec coan source -R -E {} ';'

https://coan2.sourceforge.net/coan_man_1.html
This commit is contained in:
Marco Antonio Jaguaribe Costa
2023-01-19 00:13:08 +02:00
committed by Asdow
parent 6afe785f4b
commit 8b1c4effa0
72 changed files with 0 additions and 6657 deletions
-365
View File
@@ -3633,29 +3633,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
// Unset paused for no APs.....
this->AdjustNoAPToFinishMove( FALSE );
#if 0
// 0verhaul: This is a test. The only time I have been able to make this code hit is when
// the player goes prone while moving. And that is not what this part is intended for. I
// have seen the soldier in the middle of crawling, get up, turn, and then go prone again to
// continue along his path. But this code was not hit for that part. And this code seems
// to be made for that part. So apparently they found another way to deal with it. So
// I disabled the "locked" code for usDontUpdateNewGridNoOnMoveAnimChange since it can cause
// problems of its own. Now we see if we can do without this part too.
if ( usNewState == CRAWLING && this->usDontUpdateNewGridNoOnMoveAnimChange == 1 )
{
if ( this->flags.bTurningFromPronePosition != TURNING_FROM_PRONE_ENDING_UP_FROM_MOVE )
{
this->flags.bTurningFromPronePosition = TURNING_FROM_PRONE_START_UP_FROM_MOVE;
}
// ATE: IF we are starting to crawl, but have to getup to turn first......
if ( this->flags.bTurningFromPronePosition == TURNING_FROM_PRONE_START_UP_FROM_MOVE )
{
usNewState = PRONE_UP;
this->flags.bTurningFromPronePosition = TURNING_FROM_PRONE_ENDING_UP_FROM_MOVE;
}
}
#endif
// We are about to start moving
// Handle buddy beginning to move...
@@ -3795,20 +3772,8 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
// 0verhaul: Okay, here is a question: Is the "non-interrupt" supposed to be transferrable to other anims?
// That is, if one anim is not interruptable but it chains to another anim, should the "not interruptable" flag
// remain? I'm going to try out the theory that new animations should reset the "don't interrupt" flag.
#if 0
if ( uiNewAnimFlags & ANIM_NONINTERRUPT )
{
this->flags.fInNonintAnim = TRUE;
}
if ( uiNewAnimFlags & ANIM_RT_NONINTERRUPT )
{
this->flags.fRTInNonintAnim = TRUE;
}
#else
this->flags.fInNonintAnim = (uiNewAnimFlags & ANIM_NONINTERRUPT) != 0;
this->flags.fRTInNonintAnim = (uiNewAnimFlags & ANIM_RT_NONINTERRUPT) != 0;
#endif
// CHECK IF WE ARE NOT AIMING, IF NOT, RESET LAST TAGRET!
if ( !(gAnimControl[this->usAnimState].uiFlags & ANIM_FIREREADY) && !(gAnimControl[usNewState].uiFlags & ANIM_FIREREADY) )
@@ -3956,31 +3921,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
{
// CHRISL
// SANDRO - APBPConstants[AP_CROUCH] changed to GetAPsCrouch()
#if 0//dnl ch70 160913 this is wrong we cannot just add constants to sAPCost this must be done in GetAPsCrouch and GetAPsProne because all preactions calculation will show incorrect values under cursor
if ( (UsingNewInventorySystem( ) == true) && FindBackpackOnSoldier( this ) != ITEM_NOT_FOUND && !this->flags.ZipperFlag )
{
if ( usNewState == KNEEL_UP || usNewState == BIGMERC_CROUCH_TRANS_OUTOF )
{
sAPCost = GetAPsCrouch( this, FALSE ) + 2;
sBPCost = APBPConstants[BP_CROUCH] + 2;
}
else if ( usNewState == KNEEL_DOWN || usNewState == BIGMERC_CROUCH_TRANS_INTO )
{
sAPCost = GetAPsCrouch( this, FALSE ) + 1;
sBPCost = APBPConstants[BP_CROUCH] + 1;
}
else
{
sAPCost = GetAPsCrouch( this, FALSE );
sBPCost = APBPConstants[BP_CROUCH];
}
}
else
{
sAPCost = GetAPsCrouch( this, FALSE );
sBPCost = APBPConstants[BP_CROUCH];
}
#else
if ( UsingNewInventorySystem( ) )
{
if ( usNewState == KNEEL_UP || usNewState == BIGMERC_CROUCH_TRANS_OUTOF )
@@ -3999,7 +3939,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
sAPCost = GetAPsCrouch( this, FALSE );
sBPCost = APBPConstants[BP_CROUCH];
}
#endif
DeductPoints( this, sAPCost, sBPCost );
}
this->flags.fDontChargeAPsForStanceChange = FALSE;
@@ -4017,26 +3956,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
//if ( this->sGridNo == this->pathing.sFinalDestination || this->pathing.usPathIndex == 0 )
//{
// CHRISL
#if 0//dnl ch70 160913 this is wrong we cannot just add constants to sAPCost this must be done in GetAPsCrouch and GetAPsProne because all preactions calculation will show incorrect values under cursor
if ( (UsingNewInventorySystem( ) == true) && FindBackpackOnSoldier( this ) != ITEM_NOT_FOUND && !this->flags.ZipperFlag )
{
if ( usNewState == PRONE_UP )
{
sAPCost = GetAPsProne( this, FALSE ) + 2;
sBPCost = APBPConstants[BP_PRONE] + 2;
}
else
{
sAPCost = GetAPsProne( this, FALSE ) + 1;
sBPCost = APBPConstants[BP_PRONE] + 1;
}
}
else
{
sAPCost = GetAPsProne( this, FALSE );
sBPCost = APBPConstants[BP_PRONE];
}
#else
if ( UsingNewInventorySystem( ) )
{
if ( usNewState == PRONE_UP )
@@ -4055,7 +3974,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
sAPCost = GetAPsProne( this, FALSE );
sBPCost = APBPConstants[BP_PRONE];
}
#endif
DeductPoints( this, sAPCost, sBPCost );
//}
}
@@ -4394,16 +4312,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
this->flags.fForceShade = FALSE;
// CHECK IF WE ARE AT AN IDLE ACTION
#if 0
if ( gAnimControl[usNewState].uiFlags & ANIM_IDLE )
{
this->aiData.bAction = ACTION_DONE;
}
else
{
this->aiData.bAction = ACTION_BUSY;
}
#endif
// ATE; For some animations that could use some variations, do so....
if ( usNewState == CHARIOTS_OF_FIRE || usNewState == BODYEXPLODING )
@@ -5030,18 +4938,6 @@ void SOLDIERTYPE::EVENT_FireSoldierWeapon( INT32 sTargetGridNo )
// break;
//}
#if 0
// 0verhaul: This does not go here! In spite of this function's name, it is not the actual "fire" function.
// In fact this sets the muzzle flash even while the soldier may be turning to shoot, which can cause
// problems for real-time shooting.
// The correct place for this is UseGun, which already has code to set or reset the flash.
if ( IsFlashSuppressor( &this->inv[this->ubAttackingHand], this ) )
this->flags.fMuzzleFlash = FALSE;
else
this->flags.fMuzzleFlash = TRUE;
#endif
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "EVENT_FireSoldierWeapon: Muzzle flash = %d", this->flags.fMuzzleFlash ) );
@@ -5061,42 +4957,6 @@ void SOLDIERTYPE::EVENT_FireSoldierWeapon( INT32 sTargetGridNo )
//this->sLastTarget = sTargetGridNo;
this->ubTargetID = WhoIsThere2( sTargetGridNo, this->bTargetLevel );
#if 0
// if (Item[this->inv[HANDPOS].usItem].usItemClass & IC_GUN)
{
if ( this->bDoBurst )
{
// This is NOT the bullets to fire. That is done as a check of bDoBurst against the weapon burst count or
// bDoAutofire, or single-fire. So let the bullet count be managed by the firing code.
// Set the TOTAL number of bullets to be fired
// Can't shoot more bullets than we have in our magazine!
if ( this->bDoAutofire )
this->bBulletsLeft = __min( this->bDoAutofire, this->inv[this->ubAttackingHand][0]->data.gun.ubGunShotsLeft );
else
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "EVENT_FireSoldierWeapon: do burst" );
if ( this->bWeaponMode == WM_ATTACHED_GL_BURST )
this->bBulletsLeft = __min( Weapon[GetAttachedGrenadeLauncher( &this->inv[this->ubAttackingHand] )].ubShotsPerBurst, this->inv[this->ubAttackingHand][0]->data.gun.ubGunShotsLeft );
else
this->bBulletsLeft = __min( GetShotsPerBurst( &this->inv[this->ubAttackingHand] ), this->inv[this->ubAttackingHand][0]->data.gun.ubGunShotsLeft );
}
}
else if ( IsValidSecondHandShot( this ) )
{
// two-pistol attack - two bullets!
this->bBulletsLeft = 2;
}
else
{
this->bBulletsLeft = 1;
}
if ( AmmoTypes[this->inv[this->ubAttackingHand][0]->data.gun.ubGunAmmoType].numberOfBullets > 1 )
{
this->bBulletsLeft *= AmmoTypes[this->inv[this->ubAttackingHand][0]->data.gun.ubGunAmmoType].numberOfBullets;
}
}
#endif
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "!!!!!!! Starting attack, bullets left %d", this->bBulletsLeft ) );
// Convert our grid-not into an XY
@@ -5166,26 +5026,6 @@ void SOLDIERTYPE::EVENT_FireSoldierWeapon( INT32 sTargetGridNo )
}
else
{
#if 0//dnl ch72 250913 move this above as need to be done before calling SoldierReadyWeapon
// IF WE ARE IN REAl-TIME, FIRE IMMEDIATELY!
if ( ((gTacticalStatus.uiFlags & REALTIME) || !(gTacticalStatus.uiFlags & INCOMBAT)) )
{
//fDoFireRightAway = TRUE;
}
// Check if our weapon has no intermediate anim...
if ( Item[this->inv[HANDPOS].usItem].rocketlauncher || Item[this->inv[HANDPOS].usItem].grenadelauncher || Item[this->inv[HANDPOS].usItem].mortar )
///* switch( this->inv[ HANDPOS ].usItem )
// {
//case RPG7:
//case ROCKET_LAUNCHER:
//case MORTAR:
//case GLAUNCHER:*/
fDoFireRightAway = TRUE;
// break;
//}
#endif
if ( fDoFireRightAway )
{
// Set to true so we don't get toasted twice for APs..
@@ -5881,24 +5721,6 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "EVENT_SoldierGotHit" );
#if 0
// 0verhaul: Under the new ABC system this is no longer necessary.
// ATE: If we have gotten hit, but are still in our attack animation, reduce count!
switch ( this->usAnimState )
{
case SHOOT_ROCKET:
case SHOOT_MORTAR:
case THROW_ITEM:
// <SB> crouch throwing
case THROW_ITEM_CROUCHED:
// <SB> crouch throwing
case LOB_ITEM:
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "@@@@@@@ Freeing up attacker - ATTACK ANIMATION %s ENDED BY HIT ANIMATION, Now %d", gAnimControl[this->usAnimState].zAnimStr, gTacticalStatus.ubAttackBusyCount ) );
ReduceAttackBusyCount( this->ubID, FALSE );
break;
}
#endif
// DO STUFF COMMON FOR ALL TYPES
if ( ubAttackerID != NOBODY )
@@ -5909,22 +5731,6 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
// Set attacker's ID
this->ubAttackerID = ubAttackerID;
#if 0
// 0verhaul: Slashing out more unnecessary and reworked code
if ( !(this->flags.uiStatusFlags & SOLDIER_VEHICLE) )
{
// Increment being attacked count
this->bBeingAttackedCount++;
}
// if defender is a vehicle, there will be no hit animation played!
if ( !(this->flags.uiStatusFlags & SOLDIER_VEHICLE) )
{
// Increment the number of people busy doing stuff because of an attack (busy doing hit anim!)
gTacticalStatus.ubAttackBusyCount++;
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "!!!!!!! Person got hit, attack count now %d", gTacticalStatus.ubAttackBusyCount ) );
}
#endif
// ATE; Save hit location info...( for later anim determination stuff )
this->ubHitLocation = ubHitLocation;
@@ -6248,34 +6054,6 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
}
#if 0
// 0verhaul: None of this hairyness is necessary anymore! Hazaa!
// CJC: moved to after SoldierTakeDamage so that any quotes from the defender
// will not be said if they are knocked out or killed
if ( ubReason != TAKE_DAMAGE_TENTACLES && ubReason != TAKE_DAMAGE_OBJECT )
{
// OK, OK: THis is hairy, however, it's ness. because the normal freeup call uses the
// attckers intended target, and here we want to use thier actual target....
// ATE: If it's from GUNFIRE damage, keep in mind bullets...
if ( Item[usWeaponIndex].usItemClass & IC_GUN )
{
pNewSoldier = FreeUpAttackerGivenTarget( this->ubAttackerID, this->ubID );
}
else
{
pNewSoldier = ReduceAttackBusyGivenTarget( this->ubAttackerID, this->ubID );
}
if ( pNewSoldier != NULL )
{
//warning, if this code is ever uncommented, rename all this
//to this in this function, then init this to this
this = pNewSoldier;
}
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "!!!!!!! Tried to free up attacker, attack count now %d", gTacticalStatus.ubAttackBusyCount ) );
}
#endif
// Flugente: moved the damage calculation into a separate function
sBreathLoss = max( 1, (INT16)(sBreathLoss * (100 - this->GetDamageResistance( FALSE, TRUE )) / 100) );
@@ -7337,14 +7115,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InternalGetNewSoldierPath( INT32 sDestGridNo, UINT16
}
// we can use the soldier's level here because we don't have pathing across levels right now...
#if 0
// Uhhmmmm, the name of this function has "NEWPath" in it.
if ( this->pathing.bPathStored )
{
fContinue = TRUE;
}
else
#endif
{
iDest = FindBestPath( this, sDestGridNo, this->pathing.bLevel, usMovementAnim, COPYROUTE, fFlags );
fContinue = (iDest != 0);
@@ -8788,32 +8558,6 @@ UINT8 gRedGlowR[] =
};
#if 0
UINT8 gOrangeGlowR[] =
{
0, // Normal shades
20,
40,
60,
80,
100,
120,
140,
160,
180,
0, // For gray palettes
20,
40,
60,
80,
100,
120,
140,
160,
180,
};
#endif
UINT8 gOrangeGlowR[] =
{
@@ -8842,32 +8586,6 @@ UINT8 gOrangeGlowR[] =
};
#if 0
UINT8 gOrangeGlowG[] =
{
0, // Normal shades
5,
10,
25,
30,
35,
40,
45,
50,
55,
0, // For gray palettes
5,
10,
25,
30,
35,
40,
45,
50,
55,
};
#endif
UINT8 gOrangeGlowG[] =
{
@@ -12036,28 +11754,6 @@ UINT8 GetDirectionFromXY( INT16 sXPos, INT16 sYPos, SOLDIERTYPE *pSoldier )
return(atan8( sXPos2, sYPos2, sXPos, sYPos ));
}
#if 0
UINT8 atan8( INT16 x1, INT16 y1, INT16 x2, INT16 y2 )
{
static int trig[8] = {2, 3, 4, 5, 6, 7, 8, 1};
// returned values are N=1, NE=2, E=3, SE=4, S=5, SW=6, W=7, NW=8
double dx = (x2 - x1);
double dy = (y2 - y1);
double a;
int i, k;
if ( dx == 0 )
dx = 0.00390625; // 1/256th
#define PISLICES (8)
a = (atan2( dy, dx ) + PI / PISLICES) / (PI / (PISLICES / 2));
i = (int)a;
if ( a>0 )
k = i; else
if ( a<0 )
k = i + (PISLICES - 1); else
k = 0;
return(trig[k]);
}
#endif
//#if 0
UINT8 atan8( INT16 sXPos, INT16 sYPos, INT16 sXPos2, INT16 sYPos2 )
@@ -12420,22 +12116,6 @@ void SendGetNewSoldierPathEvent( SOLDIERTYPE *pSoldier, INT32 sDestGridNo, UINT1
void SendChangeSoldierStanceEvent( SOLDIERTYPE *pSoldier, UINT8 ubNewStance )
{
#if 0
EV_S_CHANGESTANCE SChangeStance;
#ifdef NETWORKED
if ( !IsTheSolderUnderMyControl( pSoldier->ubID ) )
return;
#endif
SChangeStance.ubNewStance = ubNewStance;
SChangeStance.usSoldierID = pSoldier->ubID;
SChangeStance.sXPos = pSoldier->sX;
SChangeStance.sYPos = pSoldier->sY;
SChangeStance.uiUniqueId = pSoldier->uiUniqueSoldierIdValue;
AddGameEvent( S_CHANGESTANCE, 0, &SChangeStance );
#endif
if ( ((pSoldier->ubID > 19 && !is_server) || (pSoldier->ubID > 119 && is_server)) && is_networked )return;
@@ -12458,51 +12138,6 @@ void SendBeginFireWeaponEvent( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo )
AddGameEvent( S_BEGINFIREWEAPON, 0, &SBeginFireWeapon );
}
#if 0
// This function is now obsolete. Just call ReduceAttackBusyCount.
// This function just encapolates the check for turnbased and having an attacker in the first place
void ReleaseSoldiersAttacker( SOLDIERTYPE *pSoldier )
{
INT32 cnt;
UINT8 ubNumToFree;
//if ( gTacticalStatus.uiFlags & TURNBASED && (gTacticalStatus.uiFlags & INCOMBAT) )
{
// ATE: Removed...
//if ( pSoldier->ubAttackerID != NOBODY )
{
// JA2 Gold
// set next-to-previous attacker, so long as this isn't a repeat attack
if ( pSoldier->ubPreviousAttackerID != pSoldier->ubAttackerID )
{
pSoldier->ubNextToPreviousAttackerID = pSoldier->ubPreviousAttackerID;
}
// get previous attacker id
pSoldier->ubPreviousAttackerID = pSoldier->ubAttackerID;
// Copy BeingAttackedCount here....
ubNumToFree = pSoldier->bBeingAttackedCount;
// Zero it out BEFORE, as supression may increase it again...
pSoldier->bBeingAttackedCount = 0;
for ( cnt = 0; cnt < ubNumToFree; cnt++ )
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "@@@@@@@ Freeing up attacker of %d (attacker is %d) - releasesoldierattacker num to free is %d", pSoldier->ubID, pSoldier->ubAttackerID, ubNumToFree ) );
ReduceAttackBusyCount( pSoldier->ubAttackerID, FALSE );
}
// ATE: Set to NOBODY if this person is NOT dead
// otherise, we keep it so the kill can be awarded!
if ( pSoldier->stats.bLife != 0 && pSoldier->ubBodyType != QUEENMONSTER )
{
pSoldier->ubAttackerID = NOBODY;
}
}
}
}
#endif
BOOLEAN SOLDIERTYPE::MercInWater( void )
{