mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Use SoldierID
This commit is contained in:
+4
-4
@@ -2018,7 +2018,7 @@ void GetAPChargeForShootOrStabWRTGunRaises( SOLDIERTYPE *pSoldier, INT32 sGridNo
|
||||
// Given a gridno here, check if we are on a guy - if so - get his gridno
|
||||
if ( FindSoldier( sGridNo, &usTargID, &uiMercFlags, FIND_SOLDIER_GRIDNO ) )
|
||||
{
|
||||
sGridNo = MercPtrs[ usTargID ]->sGridNo;
|
||||
sGridNo = usTargID->sGridNo;
|
||||
}
|
||||
|
||||
ubDirection = (UINT8)GetDirectionFromGridNo( sGridNo, pSoldier );
|
||||
@@ -2230,7 +2230,7 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
|
||||
// Given a gridno here, check if we are on a guy - if so - get his gridno
|
||||
if ( FindSoldier( sGridNo, &usTargID, &uiMercFlags, FIND_SOLDIER_GRIDNO ) )
|
||||
{
|
||||
sGridNo = MercPtrs[ usTargID ]->sGridNo;
|
||||
sGridNo = usTargID->sGridNo;
|
||||
}
|
||||
//usRange = GetRangeFromGridNoDiff( pSoldier->sGridNo, sGridNo );
|
||||
}
|
||||
@@ -2473,12 +2473,12 @@ INT16 MinAPsToPunch(SOLDIERTYPE *pSoldier, INT32 sGridNo)
|
||||
// sevenfm: check enemy only if we have correct gridNo
|
||||
if( !TileIsOutOfBounds(sGridNo) )
|
||||
{
|
||||
UINT16 usTargID = WhoIsThere2(sGridNo, pSoldier->bTargetLevel);
|
||||
SoldierID usTargID = WhoIsThere2(sGridNo, pSoldier->bTargetLevel);
|
||||
// Given a gridno here, check if we are on a guy - if so - get his gridno
|
||||
if(usTargID != NOBODY)
|
||||
{
|
||||
// Check if target is prone, if so, calc cost...
|
||||
if(gAnimControl[MercPtrs[usTargID]->usAnimState].ubEndHeight == ANIM_PRONE)
|
||||
if(gAnimControl[usTargID->usAnimState].ubEndHeight == ANIM_PRONE)
|
||||
bAPCost += GetAPsToChangeStance(pSoldier, ANIM_CROUCH);
|
||||
else
|
||||
bAPCost += GetAPsToChangeStance(pSoldier, ANIM_STAND);
|
||||
|
||||
@@ -190,7 +190,7 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
static BOOLEAN fValidDoubleClickPossible = FALSE;
|
||||
static BOOLEAN fCanCheckForSpeechAdvance = FALSE;
|
||||
static INT32 sMoveClickGridNo = 0;
|
||||
UINT16 usSubjectSoldier = gusSelectedSoldier;
|
||||
SoldierID usSubjectSoldier = gusSelectedSoldier;
|
||||
|
||||
// LEFT MOUSE BUTTON
|
||||
if ( gViewportRegion.uiFlags & MSYS_MOUSE_IN_AREA )
|
||||
@@ -208,7 +208,7 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
}
|
||||
if ( gusSelectedSoldier->flags.uiStatusFlags & SOLDIER_DRIVER )
|
||||
{
|
||||
pVehicle = GetSoldierStructureForVehicle( MercPtrs[ usSubjectSoldier ]->iVehicleId );
|
||||
pVehicle = GetSoldierStructureForVehicle( usSubjectSoldier->iVehicleId );
|
||||
usSubjectSoldier = pVehicle->ubID;
|
||||
}
|
||||
}
|
||||
@@ -313,7 +313,7 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
|
||||
if ( usSubjectSoldier != NOBODY )
|
||||
{
|
||||
if ( ( fResult = UIOKMoveDestination( MercPtrs[ usSubjectSoldier ], usMapPos ) ) == 1 )
|
||||
if ( ( fResult = UIOKMoveDestination( usSubjectSoldier, usMapPos ) ) == 1 )
|
||||
{
|
||||
if ( gsCurrentActionPoints != 0 )
|
||||
{
|
||||
@@ -365,7 +365,7 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
if( FindSoldierFromMouse( &usSoldierIndex, &uiMercFlags ) )
|
||||
{
|
||||
// Select guy
|
||||
if ( (uiMercFlags & SELECTED_MERC) && !( uiMercFlags & UNCONSCIOUS_MERC ) && !( MercPtrs[ usSoldierIndex ]->flags.uiStatusFlags & SOLDIER_VEHICLE ) )
|
||||
if ( (uiMercFlags & SELECTED_MERC) && !( uiMercFlags & UNCONSCIOUS_MERC ) && !( usSoldierIndex->flags.uiStatusFlags & SOLDIER_VEHICLE ) )
|
||||
{
|
||||
*puiNewEvent = M_CHANGE_TO_ADJPOS_MODE;
|
||||
}
|
||||
@@ -451,7 +451,7 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
//if ( gAnimControl[ gusSelectedSoldier->usAnimState ].uiFlags & ANIM_STATIONARY )
|
||||
//if ( gusSelectedSoldier->usAnimState == WALKING )
|
||||
{
|
||||
MercPtrs[ usSubjectSoldier ]->flags.fUIMovementFast = TRUE;
|
||||
usSubjectSoldier->flags.fUIMovementFast = TRUE;
|
||||
*puiNewEvent = C_MOVE_MERC;
|
||||
}
|
||||
}
|
||||
@@ -595,13 +595,13 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
|
||||
if ( usSubjectSoldier != NOBODY )
|
||||
{
|
||||
if ( MercPtrs[ usSubjectSoldier ]->usAnimState != RUNNING )
|
||||
if ( usSubjectSoldier->usAnimState != RUNNING )
|
||||
{
|
||||
*puiNewEvent = C_MOVE_MERC;
|
||||
}
|
||||
else
|
||||
{
|
||||
MercPtrs[ usSubjectSoldier ]->flags.fUIMovementFast = 2;
|
||||
usSubjectSoldier->flags.fUIMovementFast = 2;
|
||||
*puiNewEvent = C_MOVE_MERC;
|
||||
}
|
||||
}
|
||||
@@ -792,7 +792,7 @@ void QueryRTLeftButton( UINT32 *puiNewEvent )
|
||||
|
||||
if ( usSubjectSoldier != NOBODY )
|
||||
{
|
||||
if ( ( fResult = UIOKMoveDestination( MercPtrs[ usSubjectSoldier ], usMapPos ) ) == 1 )
|
||||
if ( ( fResult = UIOKMoveDestination( usSubjectSoldier, usMapPos ) ) == 1 )
|
||||
{
|
||||
if ( gfUIAllMoveOn )
|
||||
{
|
||||
|
||||
@@ -2924,7 +2924,7 @@ void CreateZombiefromCorpse( ROTTING_CORPSE * pCorpse, UINT16 usAnimState )
|
||||
/* certain values have to be set afterwards - the alternative would be to edit each and every function that gets called from TacticalCreateSoldier() subsequently and
|
||||
* make an exception for zombies every time...
|
||||
*/
|
||||
SOLDIERTYPE* pNewSoldier = MercPtrs[ iNewIndex ];
|
||||
SOLDIERTYPE* pNewSoldier = iNewIndex;
|
||||
|
||||
pNewSoldier->bActionPoints = 60;
|
||||
pNewSoldier->bInitialActionPoints = 60;
|
||||
|
||||
@@ -6625,7 +6625,7 @@ BOOLEAN CanMercInteractWithSelectedShopkeeper( SOLDIERTYPE *pSoldier )
|
||||
Assert( gbSelectedArmsDealerID != -1 );
|
||||
|
||||
if ( gusIDOfCivTrader != NOBODY )
|
||||
pShopkeeper = MercPtrs[gusIDOfCivTrader];
|
||||
pShopkeeper = gusIDOfCivTrader;
|
||||
else
|
||||
pShopkeeper = FindSoldierByProfileID( armsDealerInfo[gbSelectedArmsDealerID].ubShopKeeperID, FALSE );
|
||||
|
||||
|
||||
@@ -3299,17 +3299,17 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
|
||||
// REFUELING A VEHICLE
|
||||
// THE GAS_CAN IS IN THE MERCS MAIN HAND AT THIS TIME
|
||||
{
|
||||
UINT16 ubPerson;
|
||||
SOLDIERTYPE *pVehicle;
|
||||
|
||||
// Get pointer to vehicle...
|
||||
ubPerson = WhoIsThere2( pSoldier->aiData.sPendingActionData2, pSoldier->pathing.bLevel );
|
||||
pVehicle = MercPtrs[ ubPerson ];
|
||||
SoldierID ubPerson = WhoIsThere2( pSoldier->aiData.sPendingActionData2, pSoldier->pathing.bLevel );
|
||||
if ( ubPerson != NOBODY )
|
||||
{
|
||||
SOLDIERTYPE *pVehicle = ubPerson;
|
||||
|
||||
// this is a ubID for soldiertype....
|
||||
AddFuelToVehicle( pSoldier, pVehicle );
|
||||
// this is a ubID for soldiertype....
|
||||
AddFuelToVehicle( pSoldier, pVehicle );
|
||||
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -1496,7 +1496,7 @@ void EndInterrupt( BOOLEAN fMarkInterruptOccurred )
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN StandardInterruptConditionsMet( SOLDIERTYPE * pSoldier, UINT16 ubOpponentID, INT8 bOldOppList)
|
||||
BOOLEAN StandardInterruptConditionsMet( SOLDIERTYPE * pSoldier, SoldierID ubOpponentID, INT8 bOldOppList)
|
||||
{
|
||||
DebugMsg (TOPIC_JA2INTERRUPT,DBG_LEVEL_3,"StandardInterruptConditionsMet");
|
||||
// UINT8 ubAniType;
|
||||
@@ -1540,7 +1540,7 @@ BOOLEAN StandardInterruptConditionsMet( SOLDIERTYPE * pSoldier, UINT16 ubOpponen
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
pOpponent = MercPtrs[ ubOpponentID ];
|
||||
pOpponent = ubOpponentID;
|
||||
}
|
||||
else // no opponent, so controller of 'ptr' makes the call instead
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ extern BOOLEAN gfHiddenTurnbased;
|
||||
|
||||
#define INTERRUPT_QUEUED (gubOutOfTurnPersons > 0)
|
||||
|
||||
extern BOOLEAN StandardInterruptConditionsMet( SOLDIERTYPE * pSoldier, UINT16 ubOpponentID, INT8 bOldOppList);
|
||||
extern BOOLEAN StandardInterruptConditionsMet( SOLDIERTYPE * pSoldier, SoldierID ubOpponentID, INT8 bOldOppList);
|
||||
extern INT8 CalcInterruptDuelPts( SOLDIERTYPE * pSoldier, SoldierID ubOpponentID, BOOLEAN fUseWatchSpots );
|
||||
extern void EndAITurn( void );
|
||||
extern void DisplayHiddenInterrupt( SOLDIERTYPE * pSoldier );
|
||||
|
||||
@@ -7233,12 +7233,12 @@ void SwapMercPortraits ( SOLDIERTYPE *pSoldier, INT8 bDirection )
|
||||
if ( gpCurrentTalkingFace != NULL )
|
||||
return;
|
||||
|
||||
UINT16 ubSourceMerc = gusSelectedSoldier;
|
||||
UINT16 ubTargetMerc;
|
||||
SoldierID ubSourceMerc = gusSelectedSoldier;
|
||||
SoldierID ubTargetMerc;
|
||||
INT32 iSourceFace;
|
||||
INT32 iTargetFace;
|
||||
UINT8 ubGroupID = pSoldier->ubGroupID;
|
||||
INT8 bOldPosition = GetTeamSlotFromPlayerID ( MercPtrs[ ubSourceMerc ]->ubID );
|
||||
INT8 bOldPosition = GetTeamSlotFromPlayerID ( ubSourceMerc );
|
||||
INT8 bNewPosition = bOldPosition + bDirection;
|
||||
SOLDIERTYPE TempMenptr = Menptr[ ubSourceMerc ];
|
||||
|
||||
@@ -7266,15 +7266,15 @@ void SwapMercPortraits ( SOLDIERTYPE *pSoldier, INT8 bDirection )
|
||||
ubTargetMerc = gTeamPanel[ bNewPosition ].ubID;
|
||||
|
||||
// Hey, you're dead. I don't want to swap with you.
|
||||
if ( MercPtrs[ubTargetMerc]->stats.bLife <= 0 )
|
||||
if ( ubTargetMerc->stats.bLife <= 0 )
|
||||
{
|
||||
RebuildCurrentSquad( );
|
||||
return;
|
||||
}
|
||||
|
||||
// store face indexes
|
||||
iSourceFace = MercPtrs[ ubSourceMerc ]->iFaceIndex;
|
||||
iTargetFace = MercPtrs[ ubTargetMerc ]->iFaceIndex;
|
||||
iSourceFace = ubSourceMerc->iFaceIndex;
|
||||
iTargetFace = ubTargetMerc->iFaceIndex;
|
||||
FACETYPE TempFace = gFacesData[ iSourceFace ];
|
||||
|
||||
// swap the data
|
||||
@@ -7299,11 +7299,11 @@ void SwapMercPortraits ( SOLDIERTYPE *pSoldier, INT8 bDirection )
|
||||
Menptr[ ubTargetMerc ].iFaceIndex = iTargetFace;
|
||||
|
||||
// update group info
|
||||
RemovePlayerFromGroup( ubGroupID, MercPtrs[ ubSourceMerc ] );
|
||||
RemovePlayerFromGroup( ubGroupID, MercPtrs[ ubTargetMerc ] );
|
||||
AddPlayerToGroup( ubGroupID, MercPtrs[ ubSourceMerc ] );
|
||||
AddPlayerToGroup( ubGroupID, MercPtrs[ ubTargetMerc ] );
|
||||
SortSquadByID( MercPtrs[ ubSourceMerc ]->bAssignment );
|
||||
RemovePlayerFromGroup( ubGroupID, ubSourceMerc );
|
||||
RemovePlayerFromGroup( ubGroupID, ubTargetMerc );
|
||||
AddPlayerToGroup( ubGroupID, ubSourceMerc );
|
||||
AddPlayerToGroup( ubGroupID, ubTargetMerc );
|
||||
SortSquadByID( ubSourceMerc->bAssignment );
|
||||
RebuildCurrentSquad( );
|
||||
|
||||
// don't forget to renew selection of merc
|
||||
|
||||
Reference in New Issue
Block a user