- Fix: security check for underflows when adding reinforcements

- Fix: added defined heights for kid's heads and torsos to correctly apply headshots
- Fix: While filling canteens, poisoned water from sectors is only consumed if no water drum is found

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5684 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2012-11-12 20:10:28 +00:00
parent 004728d2e4
commit 1a7e900df5
4 changed files with 79 additions and 22 deletions
+9 -6
View File
@@ -759,7 +759,14 @@ void SectorFillCanteens( void )
// If not, see if there is a water drum, and fill up the canteens from that one
UINT8 waterquality = GetWaterQuality(gWorldSectorX, gWorldSectorY, gbWorldSectorZ);
if ( waterquality == WATER_DRINKABLE || waterquality == WATER_POISONOUS )
// search for a water drum
BOOLEAN waterdrumfound = FALSE;
OBJECTTYPE* pWaterDrum = GetUsableWaterDrumInSector();
if ( !pWaterDrum || !(pWaterDrum->exists()) )
waterdrumfound = TRUE;
// drink from sector if water is ok, or it is poisonous but we haven't found a useable water drum
if ( waterquality == WATER_DRINKABLE || (waterquality == WATER_POISONOUS && !waterdrumfound) )
{
// the temperature of the water in this sector (temperature reflects the quality)
FLOAT addtemperature = OVERHEATING_MAX_TEMPERATURE;
@@ -837,12 +844,8 @@ void SectorFillCanteens( void )
}
}
}
else
else if ( waterdrumfound )
{
OBJECTTYPE* pWaterDrum = GetUsableWaterDrumInSector();
if ( !pWaterDrum || !(pWaterDrum->exists()) )
return;
INT32 drumsize = Food[Item[pWaterDrum->usItem].foodtype].bDrinkPoints;
// first step: fill all canteens in inventories