Bugfixes / Improvements (macros) of Assignments (by Franimus)

- Fixed warning for INT8 overflow on scroll region priority, seemingly had no effect though
- Use new assignment macros
- Bugfix - POWs' activity level being overwritten
- Feature - automatically bandage bleeding mercs on a PATIENT assignment
- Bugfix - mercs treated at facilities should not use mercs' medkits
- Added 3 new enums for facility doctor, patient, and repair
- Bugfix for facility patients not detected as being in a facility
- Bugfix - iBurstAPCost was ignoring half of its calculation due to extraneous semicolon


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7988 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2015-09-12 11:27:28 +00:00
parent 3ab623e452
commit a2589f7034
21 changed files with 242 additions and 150 deletions
+5 -15
View File
@@ -771,33 +771,22 @@ INT8 GetSoldierFacilityAssignmentIndex( SOLDIERTYPE *pSoldier )
INT8 bAssignment = pSoldier->bAssignment;
INT8 bAssignmentIndex = -1; // Return variable. -1 = Non-facility assignment.
if (bAssignment <= ON_DUTY ||
bAssignment == PATIENT ||
bAssignment == VEHICLE ||
bAssignment == IN_TRANSIT ||
bAssignment == TRAIN_TOWN ||
bAssignment == TRAIN_MOBILE ||
( bAssignment > FACILITY_REST && bAssignment != FACILITY_STRATEGIC_MILITIA_MOVEMENT && ( bAssignment < FACILITY_PRISON_SNITCH || bAssignment > FACILITY_GATHER_RUMOURS ) ))
{
// Soldier is performing a distinctly NON-FACILITY assignment.
return (-1);
}
if (pSoldier->sFacilityTypeOperated == -1)
{
// Soldier is not set to work at a facility...
return (-1);
}
// switch of ALL possible facility assignments
switch (bAssignment)
{
case DOCTOR:
case FACILITY_DOCTOR:
bAssignmentIndex = FAC_DOCTOR;
break;
case PATIENT:
case FACILITY_PATIENT:
bAssignmentIndex = FAC_PATIENT;
break;
case REPAIR:
case FACILITY_REPAIR:
// Determine which kind of repair is he performing
if ( pSoldier->bVehicleUnderRepairID != -1 )
{
@@ -945,6 +934,7 @@ INT8 GetSoldierFacilityAssignmentIndex( SOLDIERTYPE *pSoldier )
bAssignmentIndex = FAC_STRATEGIC_MILITIA_MOVEMENT;
break;
default:
// Soldier is performing a distinctly NON-FACILITY assignment.
bAssignmentIndex = -1;
break;
}