Fix: Under certain conditions, an overflow in healing can cause doctors to heal tremendous amounts. HealPatient() was redesigned along the way.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7563 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-10-13 20:18:35 +00:00
parent 982ad644a8
commit e6b6395f47
2 changed files with 215 additions and 271 deletions
+6 -5
View File
@@ -18739,10 +18739,11 @@ void SOLDIERTYPE::AddDiseasePoints( UINT8 aDisease, INT32 aVal )
// if disease is cured, remove traces of it
if ( this->sDiseasePoints[aDisease] <= 0 )
{
this->sDiseaseFlag[aDisease] &= ~(SOLDIERDISEASE_DIAGNOSED | SOLDIERDISEASE_OUTBREAK);
if ( this->bTeam == gbPlayerNum )
// if disease was known and this guy is under player control, let the player know the good news
if ( this->sDiseaseFlag[aDisease] & SOLDIERDISEASE_DIAGNOSED && this->bTeam == gbPlayerNum)
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szDiseaseText[TEXT_DISEASE_CURED], this->GetName( ), Disease[aDisease].szName );
this->sDiseaseFlag[aDisease] &= ~(SOLDIERDISEASE_DIAGNOSED | SOLDIERDISEASE_OUTBREAK);
}
}
}
@@ -21504,13 +21505,13 @@ UINT8 GetSquadleadersCountInVicinity( SOLDIERTYPE * pSoldier, BOOLEAN fWithHighe
UINT16 NumberOfDamagedStats( SOLDIERTYPE * pSoldier )
{
UINT16 ubTotalStatsDamaged = 0;
for ( UINT8 cnt = 0; cnt < NUM_DAMAGABLE_STATS; cnt++ )
for ( UINT8 cnt = 0; cnt < NUM_DAMAGABLE_STATS; ++cnt )
{
if ( pSoldier->ubCriticalStatDamage[cnt] > 0 )
ubTotalStatsDamaged += pSoldier->ubCriticalStatDamage[cnt];
}
// Flugente: stats can also be damaged
// Flugente: stats can also be damaged by lack of food
ubTotalStatsDamaged += pSoldier->usStarveDamageHealth;
ubTotalStatsDamaged += pSoldier->usStarveDamageStrength;