mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Fixed a 100AP conversion issue for morale and suppression fire.
Fixed a CTD caused by trying to "pickup" an item from sector inventory while simultaneously looking at that items description box. Upgraded an INT8 to INT16 in training functions to try and catch a problem with INI values being set too high. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2419 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -3731,7 +3731,7 @@ INT16 GetBonusTrainingPtsDueToInstructor( SOLDIERTYPE *pInstructor, SOLDIERTYPE
|
||||
INT8 bTraineeSkill = 0;
|
||||
INT8 bTrainerEffSkill = 0;
|
||||
INT8 bTrainerNatSkill = 0;
|
||||
INT8 bTrainingBonus = 0;
|
||||
INT16 bTrainingBonus = 0;
|
||||
INT8 bOpinionFactor;
|
||||
|
||||
// assume training impossible for max pts
|
||||
@@ -3916,7 +3916,7 @@ INT16 GetBonusTrainingPtsDueToInstructor( SOLDIERTYPE *pInstructor, SOLDIERTYPE
|
||||
INT16 GetSoldierTrainingPts( SOLDIERTYPE *pSoldier, INT8 bTrainStat, BOOLEAN fAtGunRange, UINT16 *pusMaxPts )
|
||||
{
|
||||
INT16 sTrainingPts = 0;
|
||||
INT8 bTrainingBonus = 0;
|
||||
INT16 bTrainingBonus = 0;
|
||||
INT8 bSkill = 0;
|
||||
|
||||
// assume training impossible for max pts
|
||||
@@ -3992,7 +3992,7 @@ INT16 GetSoldierTrainingPts( SOLDIERTYPE *pSoldier, INT8 bTrainStat, BOOLEAN fAt
|
||||
INT16 GetSoldierStudentPts( SOLDIERTYPE *pSoldier, INT8 bTrainStat, BOOLEAN fAtGunRange, UINT16 *pusMaxPts )
|
||||
{
|
||||
INT16 sTrainingPts = 0;
|
||||
INT8 bTrainingBonus = 0;
|
||||
INT16 bTrainingBonus = 0;
|
||||
INT8 bSkill = 0;
|
||||
|
||||
INT16 sBestTrainingPts, sTrainingPtsDueToInstructor;
|
||||
@@ -4228,7 +4228,7 @@ BOOLEAN TrainTownInSector( SOLDIERTYPE *pTrainer, INT16 sMapX, INT16 sMapY, INT1
|
||||
INT16 GetTownTrainPtsForCharacter( SOLDIERTYPE *pTrainer, UINT16 *pusMaxPts )
|
||||
{
|
||||
INT16 sTotalTrainingPts = 0;
|
||||
INT8 bTrainingBonus = 0;
|
||||
INT16 bTrainingBonus = 0;
|
||||
// UINT8 ubTownId = 0;
|
||||
|
||||
// calculate normal training pts - what it would be if his stats were "normal" (ignoring drugs, fatigue)
|
||||
|
||||
@@ -826,6 +826,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
INT16 sDistanceFromObject = 0;
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
CHAR16 sString[ 128 ];
|
||||
extern OBJECTTYPE *gpItemDescObject;
|
||||
|
||||
iCounter = MSYS_GetRegionUserData( pRegion, 0 );
|
||||
|
||||
@@ -887,6 +888,9 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
// Return if empty
|
||||
if ( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].object.exists() == false )
|
||||
return;
|
||||
// CHRISL: Also return if the item we've clicked on is currently displayed in the item description box
|
||||
if(InItemDescriptionBox( ) && gpItemDescObject == &pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].object)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7118,6 +7118,7 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker )
|
||||
UINT8 ubPointsLost, ubTotalPointsLost, ubNewStance;
|
||||
UINT32 uiLoop;
|
||||
UINT8 ubLoop2;
|
||||
UINT16 uiLoop3;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
|
||||
for (uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++)
|
||||
@@ -7166,7 +7167,9 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker )
|
||||
// morale modifier
|
||||
if (ubTotalPointsLost / 2 > pSoldier->ubAPsLostToSuppression / 2)
|
||||
{
|
||||
for ( ubLoop2 = 0; ubLoop2 < (ubTotalPointsLost / 2) - (pSoldier->ubAPsLostToSuppression / 2); ubLoop2++ )
|
||||
//CHRISL: This should dynamically adjust the number of times we run the morale loop based on AP_MAXIMUM
|
||||
uiLoop3 = (((ubTotalPointsLost / 2) - (pSoldier->ubAPsLostToSuppression / 2)) * APBPConstants[AP_MAXIMUM]) / 100;
|
||||
for ( ubLoop2 = 0; ubLoop2 < uiLoop3; ubLoop2++ )
|
||||
{
|
||||
HandleMoraleEvent( pSoldier, MORALE_SUPPRESSED, pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ );
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="8.00"
|
||||
Name="ja2_2005Express"
|
||||
ProjectGUID="{F44669E7-74AC-444B-B75F-F16F4B9F0265}"
|
||||
RootNamespace="ja2_2005Express"
|
||||
@@ -99,7 +99,7 @@
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="C:\games\jagged alliance 2 EN"
|
||||
OutputDirectory="\games\jagged alliance 2"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets=".\ja2_2005Express.vsprops"
|
||||
|
||||
Reference in New Issue
Block a user