From b5ed7df390e38472e992ba8d55e4f8e4a1c191a2 Mon Sep 17 00:00:00 2001 From: Flugente Date: Wed, 5 Nov 2014 22:01:14 +0000 Subject: [PATCH] DISEASE_CONTAMINATES_ITEMS controls wether contaminated food/blades/throwing knifes can infect people. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7649 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameSettings.cpp | 1 + GameSettings.h | 1 + Tactical/Food.cpp | 2 +- Tactical/LOS.cpp | 2 +- Tactical/Soldier Control.cpp | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/GameSettings.cpp b/GameSettings.cpp index 3fbc21d3..59283110 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1681,6 +1681,7 @@ void LoadGameExternalOptions() gGameExternalOptions.fDisease = iniReader.ReadBoolean( "Disease Settings", "DISEASE", FALSE ); gGameExternalOptions.fDiseaseStrategic = iniReader.ReadBoolean( "Disease Settings", "DISEASE_STRATEGIC", FALSE ); gGameExternalOptions.sDiseaseWHOSubscriptionCost = iniReader.ReadInteger( "Disease Settings", "DISEASE_WHO_SUBSCRIPTIONCOST", 2000, 1000, 10000 ); + gGameExternalOptions.fDiseaseContaminatesItems = iniReader.ReadBoolean( "Disease Settings", "DISEASE_CONTAMINATES_ITEMS", TRUE ); //################# Strategic Gamestart Settings ################## diff --git a/GameSettings.h b/GameSettings.h index 1ceaf20d..ea584e9c 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -414,6 +414,7 @@ typedef struct BOOLEAN fDisease; BOOLEAN fDiseaseStrategic; INT32 sDiseaseWHOSubscriptionCost; + BOOLEAN fDiseaseContaminatesItems; //Animation settings FLOAT giPlayerTurnSpeedUpFactor; diff --git a/Tactical/Food.cpp b/Tactical/Food.cpp index 4837196d..e06b6089 100644 --- a/Tactical/Food.cpp +++ b/Tactical/Food.cpp @@ -246,7 +246,7 @@ BOOLEAN ApplyFood( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObject, BOOLEAN fForce, B if ( pSoldier->sDiseasePoints[0] > 0 ) (*pObject)[0]->data.sObjectFlag |= INFECTED; // if object is infected, infect the victim - else if ( (*pObject)[0]->data.sObjectFlag & INFECTED ) + else if ( (*pObject)[0]->data.sObjectFlag & INFECTED && gGameExternalOptions.fDiseaseContaminatesItems ) pSoldier->Infect( 0 ); // now remove a portion of the food item (or the whole item altogether) diff --git a/Tactical/LOS.cpp b/Tactical/LOS.cpp index 6184e967..051daf66 100644 --- a/Tactical/LOS.cpp +++ b/Tactical/LOS.cpp @@ -2628,7 +2628,7 @@ BOOLEAN BulletHitMerc( BULLET * pBullet, STRUCTURE * pStructure, BOOLEAN fIntend } // Flugente: if bullet is infected, give us disease (this is intended for throwing knifes) - if ( pBullet->usFlags & BULLET_FLAG_INFECTED ) + if ( pBullet->usFlags & BULLET_FLAG_INFECTED && gGameExternalOptions.fDiseaseContaminatesItems ) { // infect us with the first disease pTarget->Infect( 0 ); diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index fb0d766a..3680792f 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -5799,7 +5799,7 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1 } // Flugente: if the blade is infected, infect the victim - if ( *&(MercPtrs[ubAttackerID]->inv[HANDPOS])[0]->data.sObjectFlag & INFECTED ) + if ( *&(MercPtrs[ubAttackerID]->inv[HANDPOS])[0]->data.sObjectFlag & INFECTED && gGameExternalOptions.fDiseaseContaminatesItems ) { // infect us with the first disease this->Infect( 0 );