************************************************************

* Merged Source Code from Development Trunk: Revision 4063 *
************************************************************
- Source Code is merged from: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP
- This will be the Source for the Beta 2011 Test

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4064 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2011-01-18 09:11:09 +00:00
parent 44e1646410
commit 91087ca8c0
469 changed files with 118108 additions and 24678 deletions
+47
View File
@@ -15,6 +15,9 @@
#include "Buildings.h"
#include "worldman.h"
#include "Assignments.h"
// added by SANDRO
#include "Soldier Profile.h"
#include "GameSettings.h"
#endif
//forward declarations of common classes to eliminate includes
@@ -465,3 +468,47 @@ INT8 DecideAutoBandage( SOLDIERTYPE * pSoldier )
// do nothing
return( AI_ACTION_NONE );
}
// SANDRO - added a function
BOOLEAN DoctorIsPresent( SOLDIERTYPE * pPatient, BOOLEAN fOnDoctorAssignmentCheck )
{
SOLDIERTYPE * pMedic = NULL;
UINT8 cnt;
INT8 bSlot;
BOOLEAN fDoctorHasBeenFound = FALSE;
cnt = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
for ( pMedic = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; cnt++,pMedic++)
{
if ( !(pMedic->bActive) || !(pMedic->bInSector) || ( pMedic->flags.uiStatusFlags & SOLDIER_VEHICLE ) || (pMedic->bAssignment == VEHICLE ) )
{
// is nowhere around!
continue; // NEXT!!!
}
if ( pPatient->ubID == pMedic->ubID )
{
// cannot make surgery on self!
continue; // NEXT!!!
}
if ( fOnDoctorAssignmentCheck && pMedic->bAssignment != DOCTOR )
{
// not on the right assignment!
continue; // NEXT!!!
}
bSlot = FindMedKit( pMedic );
if (bSlot == NO_SLOT)
{
// no medical kit!
continue; // NEXT!!!
}
if (pMedic->stats.bLife > OKLIFE && !(pMedic->bCollapsed) && pMedic->stats.bMedical > 0 && (NUM_SKILL_TRAITS( pMedic, DOCTOR_NT ) >= gSkillTraitValues.ubDONumberTraitsNeededForSurgery))
{
fDoctorHasBeenFound = TRUE;
}
}
return( fDoctorHasBeenFound );
}