mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Female admins and troops can appear in autoresolve.
Requires GameDir >= r2206. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7730 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -284,6 +284,8 @@ enum
|
||||
HUMAN_SKULL,
|
||||
TANK_WRECK,
|
||||
CREATURE_SKULL,
|
||||
ADMINF_FACE,
|
||||
TROOPF_FACE,
|
||||
ELITEF_FACE,
|
||||
MILITIA1F_FACE,
|
||||
MILITIA2F_FACE,
|
||||
@@ -2520,7 +2522,14 @@ void CreateAutoResolveInterface()
|
||||
{
|
||||
gpEnemies[index].pSoldier = TacticalCreateArmyTroop();
|
||||
gpEnemies[index].uiVObjectID = gpAR->iFaces;
|
||||
gpEnemies[index].usIndex = TROOP_FACE;
|
||||
if ( gpEnemies[i].pSoldier->ubBodyType == REGFEMALE )
|
||||
{
|
||||
gpEnemies[index].usIndex = TROOPF_FACE;
|
||||
}
|
||||
else
|
||||
{
|
||||
gpEnemies[index].usIndex = TROOP_FACE;
|
||||
}
|
||||
gpEnemies[index].pSoldier->sSectorX = gpAR->ubSectorX;
|
||||
gpEnemies[index].pSoldier->sSectorY = gpAR->ubSectorY;
|
||||
swprintf( gpEnemies[index].pSoldier->name, gpStrategicString[ STR_AR_TROOP_NAME ] );
|
||||
@@ -2529,7 +2538,14 @@ void CreateAutoResolveInterface()
|
||||
{
|
||||
gpEnemies[index].pSoldier = TacticalCreateAdministrator();
|
||||
gpEnemies[index].uiVObjectID = gpAR->iFaces;
|
||||
gpEnemies[index].usIndex = ADMIN_FACE;
|
||||
if ( gpEnemies[i].pSoldier->ubBodyType == REGFEMALE )
|
||||
{
|
||||
gpEnemies[index].usIndex = ADMINF_FACE;
|
||||
}
|
||||
else
|
||||
{
|
||||
gpEnemies[index].usIndex = ADMIN_FACE;
|
||||
}
|
||||
gpEnemies[index].pSoldier->sSectorX = gpAR->ubSectorX;
|
||||
gpEnemies[index].pSoldier->sSectorY = gpAR->ubSectorY;
|
||||
swprintf( gpEnemies[index].pSoldier->name, gpStrategicString[ STR_AR_ADMINISTRATOR_NAME ] );
|
||||
|
||||
+17
-22
@@ -1711,35 +1711,30 @@ BOOLEAN TacticalCopySoldierFromCreateStruct( SOLDIERTYPE *pSoldier, SOLDIERCREAT
|
||||
pSoldier->ubSoldierClass = pCreateStruct->ubSoldierClass;
|
||||
|
||||
// Flugente: soldier profiles
|
||||
if ( 1 )
|
||||
// silversurfer: Don't replace tanks!
|
||||
if ( pCreateStruct->bBodyType != TANK_NE && pCreateStruct->bBodyType != TANK_NW )
|
||||
{
|
||||
INT8 type = -1;
|
||||
// We have a function for this
|
||||
INT8 type = pSoldier->GetSoldierProfileType( pCreateStruct->bTeam );
|
||||
|
||||
// silversurfer: Don't replace tanks!
|
||||
if ( pCreateStruct->bBodyType != TANK_NE && pCreateStruct->bBodyType != TANK_NW )
|
||||
if ( type > -1 )
|
||||
{
|
||||
// We have a function for this
|
||||
type = pSoldier->GetSoldierProfileType( pCreateStruct->bTeam );
|
||||
INT16 availablenames[NUM_SOLDIER_PROFILES];
|
||||
UINT16 cnt = 0;
|
||||
|
||||
if ( type > -1 )
|
||||
for (UINT16 i = 1; i < num_found_soldier_profiles[type]; ++i)
|
||||
{
|
||||
INT16 availablenames[NUM_SOLDIER_PROFILES];
|
||||
UINT16 cnt = 0;
|
||||
// make sure the name isn't already currently in use!
|
||||
if ( !IsProfileInUse(pCreateStruct->bTeam, type, i) )
|
||||
availablenames[cnt++] = i;
|
||||
}
|
||||
|
||||
for (UINT16 i = 1; i < num_found_soldier_profiles[type]; ++i)
|
||||
{
|
||||
// make sure the name isn't already currently in use!
|
||||
if ( !IsProfileInUse(pCreateStruct->bTeam, type, i) )
|
||||
availablenames[cnt++] = i;
|
||||
}
|
||||
|
||||
if ( cnt > 0 )
|
||||
{
|
||||
pSoldier->usSoldierProfile = availablenames[Random(cnt)];
|
||||
if ( cnt > 0 )
|
||||
{
|
||||
pSoldier->usSoldierProfile = availablenames[Random(cnt)];
|
||||
|
||||
if ( zSoldierProfile[type][pSoldier->usSoldierProfile].uiBodyType > 0 && zSoldierProfile[type][pSoldier->usSoldierProfile].uiBodyType < 5 )
|
||||
pSoldier->ubBodyType = zSoldierProfile[type][pSoldier->usSoldierProfile].uiBodyType - 1;
|
||||
}
|
||||
if ( zSoldierProfile[type][pSoldier->usSoldierProfile].uiBodyType > 0 && zSoldierProfile[type][pSoldier->usSoldierProfile].uiBodyType < 5 )
|
||||
pSoldier->ubBodyType = zSoldierProfile[type][pSoldier->usSoldierProfile].uiBodyType - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user