Use SoldierID

This commit is contained in:
Asdow
2024-11-30 16:07:36 +02:00
parent d244ef4c91
commit 4645a09722
9 changed files with 79 additions and 72 deletions
+11 -9
View File
@@ -881,12 +881,14 @@ void HaltMoveForSoldierOutOfPoints(SOLDIERTYPE *pSoldier)
}
}
void SetCivilianDestination(UINT8 ubWho, INT32 sGridNo)
void SetCivilianDestination(SoldierID ubWho, INT32 sGridNo)
{
SOLDIERTYPE *pSoldier;
if ( ubWho == NOBODY )
{
return;
}
pSoldier = MercPtrs[ubWho];
SOLDIERTYPE *pSoldier = ubWho;
/*
// if we control the civilian
@@ -896,12 +898,12 @@ void SetCivilianDestination(UINT8 ubWho, INT32 sGridNo)
// if the destination is different from what he has now
if (pSoldier->aiData.usActionData != sGridNo)
{
// store his new destination
pSoldier->aiData.usActionData = sGridNo;
// store his new destination
pSoldier->aiData.usActionData = sGridNo;
// and cancel any movement in progress that he was still engaged in
pSoldier->aiData.bAction = AI_ACTION_NONE;
pSoldier->aiData.bActionInProgress = FALSE;
// and cancel any movement in progress that he was still engaged in
pSoldier->aiData.bAction = AI_ACTION_NONE;
pSoldier->aiData.bActionInProgress = FALSE;
}
// only set the underEscort flag once you give him a destination
+4 -4
View File
@@ -904,12 +904,12 @@ UINT8 CalcDesireToTalk( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach )
// SANDRO - bonus for communication with people for assertive people
if ( gGameOptions.fNewTraitSystem && bApproach != APPROACH_THREATEN)
{
INT16 id = GetSoldierIDFromMercID( ubMerc );
if ( id > -1 )
SoldierID id = GetSoldierIDFromMercID( ubMerc );
if ( id != NOBODY )
{
if ( DoesMercHavePersonality( MercPtrs[id], CHAR_TRAIT_ASSERTIVE ) )
if ( DoesMercHavePersonality( id, CHAR_TRAIT_ASSERTIVE ) )
iPersonalVal += 50;
else if ( DoesMercHavePersonality( MercPtrs[id], CHAR_TRAIT_MALICIOUS ) )
else if ( DoesMercHavePersonality( id, CHAR_TRAIT_MALICIOUS ) )
iPersonalVal -= 50;
}
}
+1 -1
View File
@@ -252,7 +252,7 @@ INT16 RandomFriendWithin(SOLDIERTYPE *pSoldier);
INT16 RoamingRange(SOLDIERTYPE *pSoldier, INT32 *pFromGridNo);
void SetCivilianDestination(UINT8 ubWho, INT32 sGridNo);
void SetCivilianDestination(SoldierID ubWho, INT32 sGridNo);
void SetNewSituation( SOLDIERTYPE * pSoldier );
UINT8 SoldierDifficultyLevel( SOLDIERTYPE * pSoldier );