- fix for stopping snitches from preventing misbehavior
- fix for stopping snitches reports
- improved code for refused handcuffing
- fixed item bug with items dropping from backpack after using transformation in turnbased mode
- improved code for dart ammotype effect
- removed assert in AddCharacterToAnySquad to prevent crash when selecting merc in vehicle and plotting travel route
- added EXPLOSV_CREATUREGAS effect in UpdateAniTiles()

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8720 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2019-12-22 06:22:23 +00:00
parent 3efe899526
commit d02a4ddd7d
6 changed files with 22 additions and 16 deletions
+3 -3
View File
@@ -419,7 +419,7 @@ void HourlyLarryUpdate()
// note - snitches stop others, but can get wasted themselves (if they have drug use specifically set in background...) // note - snitches stop others, but can get wasted themselves (if they have drug use specifically set in background...)
if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile ) if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile )
{ {
if ( ProfileHasSkillTrait( pOtherSoldier->ubProfile, SNITCH_NT ) && !( pSoldier->usSoldierFlagMask2 & SOLDIER_PREVENT_MISBEHAVIOUR_OFF ) ) if (ProfileHasSkillTrait(pOtherSoldier->ubProfile, SNITCH_NT) && !(pOtherSoldier->usSoldierFlagMask2 & SOLDIER_PREVENT_MISBEHAVIOUR_OFF))
{ {
if( pSoldier->sSectorX == pOtherSoldier->sSectorX && pSoldier->sSectorY == pOtherSoldier->sSectorY && pSoldier->bSectorZ == pOtherSoldier->bSectorZ ) if( pSoldier->sSectorX == pOtherSoldier->sSectorX && pSoldier->sSectorY == pOtherSoldier->sSectorY && pSoldier->bSectorZ == pOtherSoldier->bSectorZ )
{ {
@@ -597,7 +597,7 @@ void HourlyDisabilityUpdate( )
// note - snitches stop others, but can get wasted themselves (if they have drug use specifically set in background...) // note - snitches stop others, but can get wasted themselves (if they have drug use specifically set in background...)
if ( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile ) if ( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile )
{ {
if ( ProfileHasSkillTrait( pOtherSoldier->ubProfile, SNITCH_NT ) && !(pSoldier->usSoldierFlagMask2 & SOLDIER_PREVENT_MISBEHAVIOUR_OFF) ) if (ProfileHasSkillTrait(pOtherSoldier->ubProfile, SNITCH_NT) && !(pOtherSoldier->usSoldierFlagMask2 & SOLDIER_PREVENT_MISBEHAVIOUR_OFF))
{ {
if ( pSoldier->sSectorX == pOtherSoldier->sSectorX && pSoldier->sSectorY == pOtherSoldier->sSectorY && pSoldier->bSectorZ == pOtherSoldier->bSectorZ ) if ( pSoldier->sSectorX == pOtherSoldier->sSectorX && pSoldier->sSectorY == pOtherSoldier->sSectorY && pSoldier->bSectorZ == pOtherSoldier->bSectorZ )
{ {
@@ -729,7 +729,7 @@ void HourlyStealUpdate()
&& !pOtherSoldier->flags.fMercAsleep && !pOtherSoldier->flags.fMercAsleep
&& pSoldier->ubProfile != pOtherSoldier->ubProfile ) && pSoldier->ubProfile != pOtherSoldier->ubProfile )
{ {
if ( ProfileHasSkillTrait( pOtherSoldier->ubProfile, SNITCH_NT ) && !( pSoldier->usSoldierFlagMask2 & SOLDIER_PREVENT_MISBEHAVIOUR_OFF ) ) if (ProfileHasSkillTrait(pOtherSoldier->ubProfile, SNITCH_NT) && !(pOtherSoldier->usSoldierFlagMask2 & SOLDIER_PREVENT_MISBEHAVIOUR_OFF))
{ {
if ( pSoldier->sSectorX == pOtherSoldier->sSectorX && pSoldier->sSectorY == pOtherSoldier->sSectorY && sectorz == pOtherSoldier->bSectorZ ) if ( pSoldier->sSectorX == pOtherSoldier->sSectorX && pSoldier->sSectorY == pOtherSoldier->sSectorY && sectorz == pOtherSoldier->bSectorZ )
{ {
+4 -1
View File
@@ -1344,8 +1344,11 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
} }
// Flugente: handcuffing people // Flugente: handcuffing people
if ( gGameExternalOptions.fAllowPrisonerSystem && HasItemFlag( usHandItem, HANDCUFFS ) && pTargetSoldier && pTargetSoldier->CanBeCaptured( ) ) if (gGameExternalOptions.fAllowPrisonerSystem && HasItemFlag(usHandItem, HANDCUFFS) && pTargetSoldier)
{ {
if (!pTargetSoldier->CanBeCaptured())
return ITEM_HANDLE_REFUSAL;
// ATE: AI CANNOT GO THROUGH HERE! // ATE: AI CANNOT GO THROUGH HERE!
BOOLEAN fHadToUseCursorPos = FALSE; BOOLEAN fHadToUseCursorPos = FALSE;
+1 -1
View File
@@ -6339,7 +6339,7 @@ BOOLEAN CanItemFitInPosition( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj, INT8 bPos
case SMALLPOCK30POS: case SMALLPOCK30POS:
if( UsingNewInventorySystem() ) if( UsingNewInventorySystem() )
{ {
if(icLBE[bPos] == BPACKPOCKPOS && (!(pSoldier->flags.ZipperFlag) || (pSoldier->flags.ZipperFlag && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_STAND)) && (gTacticalStatus.uiFlags & INCOMBAT)) if (icLBE[bPos] == BPACKPOCKPOS && (!(pSoldier->flags.ZipperFlag) || (pSoldier->flags.ZipperFlag && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_STAND)) && (gTacticalStatus.uiFlags & INCOMBAT) && fDoingPlacement)
return( FALSE ); return( FALSE );
lbePocket = ( !pSoldier->inv[icLBE[bPos]].exists() ) ? LoadBearingEquipment[Item[icDefault[bPos]].ubClassIndex].lbePocketIndex[icPocket[bPos]] : LoadBearingEquipment[Item[pSoldier->inv[icLBE[bPos]].usItem].ubClassIndex].lbePocketIndex[icPocket[bPos]]; lbePocket = ( !pSoldier->inv[icLBE[bPos]].exists() ) ? LoadBearingEquipment[Item[icDefault[bPos]].ubClassIndex].lbePocketIndex[icPocket[bPos]] : LoadBearingEquipment[Item[pSoldier->inv[icLBE[bPos]].usItem].ubClassIndex].lbePocketIndex[icPocket[bPos]];
+8 -5
View File
@@ -1469,18 +1469,21 @@ void HandleSnitchesReports( std::vector<SnitchEvent>& aVec )
bSnitchID = event.ubSnitchID; bSnitchID = event.ubSnitchID;
pSnitch = FindSoldierByProfileID( bSnitchID, TRUE ); pSnitch = FindSoldierByProfileID( bSnitchID, TRUE );
if ( pSnitch == NULL ) if (pSnitch == NULL)
continue; continue;
if ( !(pSnitch->bActive) ) if (!pSnitch->bActive)
continue; continue;
if ( pSnitch->flags.fMercAsleep ) if (pSnitch->flags.fMercAsleep)
fSleepingSnitch = TRUE; fSleepingSnitch = TRUE;
if (pSnitch->usSoldierFlagMask2 & SOLDIER_SNITCHING_OFF)
continue;
// snitch introduction // snitch introduction
if ( fSleepingSnitch ) if (fSleepingSnitch)
TacticalCharacterDialogueWithSpecialEvent( pSnitch, 0, DIALOGUE_SPECIAL_EVENT_SLEEP, 0, 0 ); TacticalCharacterDialogueWithSpecialEvent(pSnitch, 0, DIALOGUE_SPECIAL_EVENT_SLEEP, 0, 0);
SnitchTacticalCharacterDialogue( pSnitch, 0, SNITCH_INTRODUCTION, NO_PROFILE, NO_PROFILE ); SnitchTacticalCharacterDialogue( pSnitch, 0, SNITCH_INTRODUCTION, NO_PROFILE, NO_PROFILE );
+2 -1
View File
@@ -451,7 +451,8 @@ BOOLEAN AddCharacterToAnySquad( SOLDIERTYPE *pCharacter )
} }
// should never happen! // should never happen!
Assert( FALSE ); //Assert( FALSE );
return( FALSE ); return( FALSE );
} }
+4 -5
View File
@@ -7279,23 +7279,22 @@ void NoticeUnseenAttacker( SOLDIERTYPE * pAttacker, SOLDIERTYPE * pDefender, INT
INT8 bDirection; INT8 bDirection;
BOOLEAN fMuzzleFlash = FALSE; BOOLEAN fMuzzleFlash = FALSE;
if ( !(gTacticalStatus.uiFlags & INCOMBAT) ) if (!(gTacticalStatus.uiFlags & INCOMBAT))
{ {
return; return;
} }
if ( pAttacker->usAttackingWeapon == DART_GUN ) if (AmmoTypes[pAttacker->inv[pAttacker->ubAttackingHand][0]->data.gun.ubGunAmmoType].dart)
{ {
// rarely noticed // rarely noticed
if ( SkillCheck( pDefender, NOTICE_DART_CHECK, 0 ) < 0) if (SkillCheck(pDefender, NOTICE_DART_CHECK, 0) < 0)
{ {
return; return;
} }
} }
// do we need to do checks for life/breath here? // do we need to do checks for life/breath here?
if (pDefender->ubBodyType == LARVAE_MONSTER || (pDefender->flags.uiStatusFlags & SOLDIER_VEHICLE && pDefender->bTeam == OUR_TEAM))
if ( pDefender->ubBodyType == LARVAE_MONSTER || (pDefender->flags.uiStatusFlags & SOLDIER_VEHICLE && pDefender->bTeam == OUR_TEAM) )
{ {
return; return;
} }