mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Convert gusSelectedSoldier to SoldierID
This commit is contained in:
@@ -104,7 +104,7 @@ UINT32 AniEditScreenHandle(void)
|
||||
fToggle2 = FALSE;
|
||||
ubCurLoadedState = 0;
|
||||
|
||||
pSoldier = MercPtrs[ gusSelectedSoldier ];
|
||||
pSoldier = gusSelectedSoldier;
|
||||
|
||||
gTacticalStatus.uiFlags |= LOADING_SAVED_GAME;
|
||||
|
||||
|
||||
+6
-6
@@ -261,17 +261,17 @@ void EnterTacticalScreen( )
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
{
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: check our guy"));
|
||||
if ( !OK_CONTROLLABLE_MERC( MercPtrs[ gusSelectedSoldier ] ) )
|
||||
if ( !OK_CONTROLLABLE_MERC( gusSelectedSoldier ) )
|
||||
{
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: SelectNextAvailSoldier, merc not controllable"));
|
||||
SelectNextAvailSoldier( MercPtrs[ gusSelectedSoldier ] );
|
||||
SelectNextAvailSoldier( gusSelectedSoldier );
|
||||
}
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: who is selected? %d", gusSelectedSoldier));
|
||||
// ATE: If the current guy is sleeping, change....
|
||||
if ( gusSelectedSoldier != NOBODY && MercPtrs[ gusSelectedSoldier ]->flags.fMercAsleep )
|
||||
if ( gusSelectedSoldier != NOBODY && gusSelectedSoldier->flags.fMercAsleep )
|
||||
{
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: SelectNextAvailSoldier, merc asleep"));
|
||||
SelectNextAvailSoldier( MercPtrs[ gusSelectedSoldier ] );
|
||||
SelectNextAvailSoldier( gusSelectedSoldier );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -684,7 +684,7 @@ UINT32 MainGameScreenHandle(void)
|
||||
// Select a guy if he hasn;'
|
||||
if( !gfTacticalPlacementGUIActive )
|
||||
{
|
||||
if ( gusSelectedSoldier != NOBODY && OK_INTERRUPT_MERC( MercPtrs[ gusSelectedSoldier ] ) )
|
||||
if ( gusSelectedSoldier != NOBODY && OK_INTERRUPT_MERC( gusSelectedSoldier ) )
|
||||
{
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("maingamescreenhandle: selectsoldier"));
|
||||
SelectSoldier( gusSelectedSoldier, FALSE, TRUE );
|
||||
@@ -933,7 +933,7 @@ UINT32 MainGameScreenHandle(void)
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
{
|
||||
if( !gGameSettings.fOptions[ TOPTION_MUTE_CONFIRMATIONS ] )
|
||||
MercPtrs[ gusSelectedSoldier ]->DoMercBattleSound( BATTLE_SOUND_ATTN1 );
|
||||
gusSelectedSoldier->DoMercBattleSound( BATTLE_SOUND_ATTN1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+14
-30
@@ -514,31 +514,25 @@ UINT32 PalEditScreenShutdown(void)
|
||||
|
||||
void PalEditRenderHook( )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
if ( gusSelectedSoldier < NOBODY && gusSelectedSoldier->bActive)
|
||||
{
|
||||
// Set to current
|
||||
GetSoldier( &pSoldier, gusSelectedSoldier );
|
||||
|
||||
DisplayPaletteRep( pSoldier->HeadPal, 50, 10, FRAME_BUFFER );
|
||||
DisplayPaletteRep( pSoldier->PantsPal, 50, 50, FRAME_BUFFER );
|
||||
DisplayPaletteRep( pSoldier->VestPal, 50, 90, FRAME_BUFFER );
|
||||
DisplayPaletteRep( pSoldier->SkinPal, 50, 130, FRAME_BUFFER );
|
||||
|
||||
DisplayPaletteRep( gusSelectedSoldier->HeadPal, 50, 10, FRAME_BUFFER );
|
||||
DisplayPaletteRep( gusSelectedSoldier->PantsPal, 50, 50, FRAME_BUFFER );
|
||||
DisplayPaletteRep( gusSelectedSoldier->VestPal, 50, 90, FRAME_BUFFER );
|
||||
DisplayPaletteRep( gusSelectedSoldier->SkinPal, 50, 130, FRAME_BUFFER );
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN PalEditKeyboardHook( InputAtom *pInputEvent )
|
||||
{
|
||||
UINT8 ubType;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
UINT8 ubPaletteRep;
|
||||
UINT32 cnt;
|
||||
UINT8 ubStartRep = 0;
|
||||
UINT8 ubEndRep = 0;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
UINT32 cnt;
|
||||
UINT8 ubType;
|
||||
UINT8 ubPaletteRep;
|
||||
UINT8 ubStartRep = 0;
|
||||
UINT8 ubEndRep = 0;
|
||||
|
||||
if ( gusSelectedSoldier == NOBODY )
|
||||
if ( gusSelectedSoldier >= NOBODY || gusSelectedSoldier->bActive == FALSE )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -549,11 +543,10 @@ BOOLEAN PalEditKeyboardHook( InputAtom *pInputEvent )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
pSoldier = gusSelectedSoldier;
|
||||
|
||||
if ((pInputEvent->usEvent == KEY_DOWN )&& ( pInputEvent->usParam == 'h' ))
|
||||
{
|
||||
// Get Soldier
|
||||
GetSoldier( &pSoldier, gusSelectedSoldier );
|
||||
|
||||
// Get index of current
|
||||
CHECKF( GetPaletteRepIndexFromID( pSoldier->HeadPal, &ubPaletteRep ) );
|
||||
ubType = gpPalRep[ ubPaletteRep ].ubType;
|
||||
@@ -582,9 +575,6 @@ BOOLEAN PalEditKeyboardHook( InputAtom *pInputEvent )
|
||||
|
||||
if ((pInputEvent->usEvent == KEY_DOWN )&& ( pInputEvent->usParam == 'v' ))
|
||||
{
|
||||
// Get Soldier
|
||||
GetSoldier( &pSoldier, gusSelectedSoldier );
|
||||
|
||||
// Get index of current
|
||||
CHECKF( GetPaletteRepIndexFromID( pSoldier->VestPal, &ubPaletteRep ) );
|
||||
ubType = gpPalRep[ ubPaletteRep ].ubType;
|
||||
@@ -612,9 +602,6 @@ BOOLEAN PalEditKeyboardHook( InputAtom *pInputEvent )
|
||||
|
||||
if ((pInputEvent->usEvent == KEY_DOWN )&& ( pInputEvent->usParam == 'p' ))
|
||||
{
|
||||
// Get Soldier
|
||||
GetSoldier( &pSoldier, gusSelectedSoldier );
|
||||
|
||||
// Get index of current
|
||||
CHECKF( GetPaletteRepIndexFromID( pSoldier->PantsPal, &ubPaletteRep ) );
|
||||
ubType = gpPalRep[ ubPaletteRep ].ubType;
|
||||
@@ -642,9 +629,6 @@ BOOLEAN PalEditKeyboardHook( InputAtom *pInputEvent )
|
||||
|
||||
if ((pInputEvent->usEvent == KEY_DOWN )&& ( pInputEvent->usParam == 's' ))
|
||||
{
|
||||
// Get Soldier
|
||||
GetSoldier( &pSoldier, gusSelectedSoldier );
|
||||
|
||||
// Get index of current
|
||||
CHECKF( GetPaletteRepIndexFromID( pSoldier->SkinPal, &ubPaletteRep ) );
|
||||
ubType = gpPalRep[ ubPaletteRep ].ubType;
|
||||
|
||||
Reference in New Issue
Block a user