Skip to content

Increased Team Sizes (ITS) #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 184 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
1f0a8f4
Import changes from the local SVN working copy
Asdow Oct 10, 2022
5c13170
Create .gitignore
Asdow Oct 10, 2022
03482ff
Merge branch 'master' into ExtraMercs
Asdow Jul 26, 2023
9fb4ef8
Merge branch 'master' into ExtraMercs
Asdow Jul 27, 2023
9ac53ca
Fix UINT8 references to pSoldier->ubID to UINT16
Asdow Jul 27, 2023
57cc888
Allow more creatures, civs and rebels
Asdow Jul 27, 2023
06918d7
Update Item Types.h
Asdow Jul 29, 2023
10250dc
Merge branch 'master' into ExtraMercs
Asdow Nov 9, 2024
4e253d0
Update Dialogue Control.cpp
Asdow Nov 9, 2024
1787597
Update LOS.cpp
Asdow Nov 9, 2024
bc87012
Implement page scrolling in Laptop Personnel page
Asdow Nov 9, 2024
f99065d
Remove unused button callback functions
Asdow Nov 9, 2024
a81820d
Fix UB compilation
Asdow Nov 9, 2024
2b024d6
Fix endless loop
Asdow Nov 9, 2024
fdd6859
Implement multiselection for contract renewal
Asdow Nov 9, 2024
5cf0ef4
Correct variables from INT8 to INT16
Asdow Nov 9, 2024
508310b
Change UINT8 to UINT16 for soldierInitLists & hostiles in sector
Asdow Nov 9, 2024
d9edc93
Fix loading of tactical status
Asdow Nov 10, 2024
0089e0a
Change strategic enemy amounts to UINT16
Asdow Nov 10, 2024
040410b
Whitespace formatting for SAVED_GAME_HEADER
Asdow Nov 10, 2024
fcf2b27
More UINT8 -> UINT16 changes
Asdow Nov 10, 2024
6c33009
Remove bLastKnownEnemies from SECTORINFO
Asdow Nov 10, 2024
3c25928
Fix ShadeMapElements function declaration
Asdow Nov 11, 2024
d6370b7
Fix invisible cows and bloodcats
Asdow Nov 12, 2024
aad6ed8
Implemented SoldierID type to replace SOLDIERTYPE->ubID
Asdow Nov 12, 2024
4d74005
Provide access function to MenPtrs, MercPtrs & MercSlots
Asdow Nov 12, 2024
f5b1447
Move MercSlots zeroing to same loop where MercPtrs are set
Asdow Nov 13, 2024
0103a87
Operator overloads for accessing SOLDIERTYPE* through SoldierID
Asdow Nov 13, 2024
1345d92
Convert Soldier Find.cpp to SoldierID
Asdow Nov 13, 2024
c04cc4c
Update Map Screen Interface.h
Asdow Nov 13, 2024
1327d18
Use usSolID directly
Asdow Nov 13, 2024
568aa0a
Update Item Types.cpp
Asdow Nov 14, 2024
6a0d02e
Change type from BOOLEAN(!) to SoldierID
Asdow Nov 14, 2024
7350758
Fix incorrect variables
Asdow Nov 14, 2024
0def972
Convert SetInfoChar & DrawFace to use SoldierID
Asdow Nov 14, 2024
d07dcf4
Update Scheduling.h
Asdow Nov 14, 2024
b9deb3c
PossiblyStartEnemyTaunt( uiTargetId ) to SoldierID
Asdow Nov 14, 2024
1c631cb
REAL_OBJECT.ubLastTargetTakenDamage -> SoldierID
Asdow Nov 14, 2024
337cf18
Update Overhead Types.h
Asdow Nov 14, 2024
cba88ab
Update LuaInitNPCs.cpp
Asdow Nov 14, 2024
e9c8124
Fix UB compilation
Asdow Nov 15, 2024
b98732d
Convert gusSelectedSoldier to SoldierID
Asdow Nov 15, 2024
83b3485
Convert prisonerdialoguetargetID to SoldierID
Asdow Nov 15, 2024
ecb29ae
Convert SOLDIERTYPE->usChatPartnerID to SoldierID
Asdow Nov 15, 2024
9079f2e
Whitespace changes to SOLDIERTYPE
Asdow Nov 15, 2024
ee429fd
Convert SOLDIERTYPE->ubAttackerID to SoldierID
Asdow Nov 15, 2024
131172e
Convert SOLDIERTYPE->ubPreviousAttackerID to SoldierID
Asdow Nov 15, 2024
8346d5b
Convert SOLDIERTYPE->ubNextToPreviousAttackerID to SoldierID
Asdow Nov 15, 2024
1a17242
Update Soldier Create.cpp
Asdow Nov 15, 2024
5de6f77
Convert SOLDIERTYPE::ubOppNum to SoldierID
Asdow Nov 15, 2024
f823cb9
Update Soldier Control.h
Asdow Nov 15, 2024
566ead5
Convert SOLDIERTYPE::ubTargetID to SoldierID
Asdow Nov 15, 2024
75deccb
Convert SOLDIERTYPE::ubRobotRemoteHolderID to SoldierID
Asdow Nov 15, 2024
153d402
Update Soldier Control.h
Asdow Nov 15, 2024
8ef7fb5
Convert SOLDIERTYPE::usDragPersonID to SoldierID
Asdow Nov 15, 2024
419b0c7
SOLDIERTYPE::CreateSoldierCommon to SoldierID
Asdow Nov 15, 2024
b112d39
Convert SOLDIERTYPE::EVENT_SoldierGotHit to SoldierID
Asdow Nov 15, 2024
23af6b6
SoldierTakeDamage & SoldierTakeDelayedDamage to SoldierID
Asdow Nov 15, 2024
41fc407
Convert TacticalRemoveSoldier to SoldierID
Asdow Nov 15, 2024
98c1849
Update GENERAL_SAVE_INFO::sContractRehireSoldierID to SoldierID
Asdow Nov 15, 2024
3ff4cc0
GENERAL_SAVE_INFO members to SoldierID
Asdow Nov 15, 2024
e7fe1d1
Update LaptopSave.h
Asdow Nov 16, 2024
edb26a6
Guard against array out of bounds access
Asdow Nov 16, 2024
d28d46d
SOLDIERTYPE::bOverrideMoveSpeed to SoldierID
Asdow Nov 16, 2024
cd720a6
Fix Dismiss Merc not working after selecting several soldiers
Asdow Nov 16, 2024
42d5ecb
HandleLeavingOfEquipmentInCurrentSector() to SoldierID
Asdow Nov 16, 2024
2918801
AddSoldierToSector & OBJECTTYPE::soldierID changed to SoldierID
Asdow Nov 16, 2024
c475f9e
Convert MapScreenCharacterSt::usSolID to SoldierID
Asdow Nov 16, 2024
61c5a41
LocateSoldier() & HandleMercLeavingEquipmentInDrassen() & HandleMercL…
Asdow Nov 16, 2024
f0be44b
Convert to SoldierID
Asdow Nov 17, 2024
cbf53f8
TacticalStatusType::ubLastRequesterSurgeryTargetID to SoldierID
Asdow Nov 17, 2024
3e1c87f
Remove unused global gusOldSelectedSoldier
Asdow Nov 17, 2024
3fe6e4f
GetSoldier() to SoldierID
Asdow Nov 17, 2024
ab94d33
PlaySoldierJA2Sample() to SoldierID
Asdow Nov 17, 2024
30e6b90
SetUIBusy() & UnSetUIBusy() to SoldierID
Asdow Nov 17, 2024
f58cf58
Mark TacticalStatusType::sSlideReason as _UNUSED
Asdow Nov 17, 2024
34f0b40
Convert functions and globals to SoldierID
Asdow Nov 17, 2024
274be52
More functions converted to SoldierID
Asdow Nov 17, 2024
2e147d4
Convert to SoldierID
Asdow Nov 17, 2024
f390783
Remove unused function parameters
Asdow Nov 17, 2024
2e92da4
Convert to SoldierID
Asdow Nov 17, 2024
9d62b9a
Remove unused function parameters
Asdow Nov 17, 2024
9acf994
Convert gusTempDragBuildSoldierID to SoldierID
Asdow Nov 17, 2024
e9a13e1
Convert to SoldierID
Asdow Nov 17, 2024
06936b7
Convert to SoldierID
Asdow Nov 17, 2024
74d752d
More conversions to SoldierID
Asdow Nov 17, 2024
9532fbf
Convert to SoldierID
Asdow Nov 17, 2024
f50bdf9
Convert to SoldierID
Asdow Nov 17, 2024
b9641d4
Convert to SoldierID
Asdow Nov 17, 2024
b6e8b0c
Convert to SoldierID
Asdow Nov 17, 2024
ef9aa1b
Convert to SoldierID
Asdow Nov 17, 2024
d149b6f
Correct parameter order
Asdow Nov 17, 2024
b74ccf3
Convert to SoldierID
Asdow Nov 17, 2024
657097a
Remove unused global
Asdow Nov 17, 2024
f490133
Convert to SoldierID
Asdow Nov 17, 2024
fa56a7a
Update Scheduling.cpp
Asdow Nov 18, 2024
66bd1e4
Correct loops
Asdow Nov 18, 2024
c75f577
Guard against out of bounds access
Asdow Nov 18, 2024
e62684f
Convert GetSoldierIDFromMercID() to SoldierID
Asdow Nov 18, 2024
07420ce
Revert "Guard against out of bounds access"
Asdow Nov 18, 2024
d2388c7
Modify SoldierID constructor to prevent invalid valuels
Asdow Nov 18, 2024
3ddc4c2
Change to SoldierID
Asdow Nov 18, 2024
38b7103
Fix incorrect function argument
Asdow Nov 18, 2024
dd2c6f4
Fix incorrect function arguments
Asdow Nov 18, 2024
ca11123
Increase ubUserData2 from UINT8 to UINT16
Asdow Nov 18, 2024
9fb29cf
Remove UINT8 conversions
Asdow Nov 18, 2024
e9e8080
Update merccompare.cpp
Asdow Nov 18, 2024
cd83fac
Update Air Raid.cpp
Asdow Nov 18, 2024
bc01bdb
Convert to SoldierID
Asdow Nov 18, 2024
9bbec03
Remove unnecessary casts
Asdow Nov 18, 2024
924ccd8
Use ubID instead of cnt
Asdow Nov 18, 2024
883ceb2
Convert to SoldierID
Asdow Nov 18, 2024
2387667
Initialize SOLDIERTYPE SoldierIDs to NOBODY
Asdow Nov 18, 2024
df01708
Update Soldier Control.cpp
Asdow Nov 18, 2024
3270469
Converto to SoldierID
Asdow Nov 18, 2024
b718b46
Use SoldierID
Asdow Nov 18, 2024
1e16de3
Remove wrong cast
Asdow Nov 18, 2024
94a5972
Perform explicit casts from UINT8 to UINT16 for SoldierID
Asdow Nov 18, 2024
191af4d
Update SoldierID constructors
Asdow Nov 18, 2024
65c4cdd
Suppress compiler warnings by using SoldierID::i directly
Asdow Nov 18, 2024
47824c9
Fix UB compilation
Asdow Nov 18, 2024
18673f3
Remove compiler warning
Asdow Nov 18, 2024
3f448a6
Remove unused functions
Asdow Nov 18, 2024
5b4be9b
Convert to SoldierID
Asdow Nov 18, 2024
ff638a5
Convert to SoldierID
Asdow Nov 18, 2024
534ce66
Convert to SoldierID
Asdow Nov 18, 2024
be5c4b1
Convert to SoldierID
Asdow Nov 19, 2024
8b90c84
Convert DisplayCharStats() to SoldierID
Asdow Nov 19, 2024
698176e
Convert DisplayCharPersonality() to SoldierID
Asdow Nov 19, 2024
648a50f
Convert currentTeamList to SoldierID
Asdow Nov 19, 2024
2a52347
Update personnel.cpp
Asdow Nov 19, 2024
a670aff
Combine loops to check for medics and patients
Asdow Nov 19, 2024
235ddfa
Update Game Event Hook.cpp
Asdow Nov 19, 2024
c7e654a
Update Town Militia.cpp
Asdow Nov 19, 2024
aee7c23
Update Air Raid.cpp
Asdow Nov 19, 2024
cebd20f
Update ShopKeeper Interface.cpp
Asdow Nov 19, 2024
cabb50a
Update Game Event Hook.cpp
Asdow Nov 19, 2024
e4fe066
Fix comment
Asdow Nov 20, 2024
8e4307b
Use SoldierID
Asdow Nov 20, 2024
bb1c63d
Convert to SoldierID
Asdow Nov 20, 2024
d826491
Remove unused function parameter
Asdow Nov 20, 2024
dbc4135
Use SoldierID
Asdow Nov 20, 2024
8856813
Lessen copy & paste
Asdow Nov 20, 2024
3f4c946
Fix compiler warnings
Asdow Nov 20, 2024
63fe0be
Use SoldierID
Asdow Nov 20, 2024
2935413
Use SoldierID
Asdow Nov 20, 2024
9d0ec49
Use SoldierID
Asdow Nov 20, 2024
65a8b4f
Use SoldierID
Asdow Nov 20, 2024
7fffcd2
Simplify function
Asdow Nov 20, 2024
58bffff
Simplify if checks
Asdow Nov 20, 2024
99703fa
Use SoldierID
Asdow Nov 20, 2024
845d784
Use SoldierID
Asdow Nov 20, 2024
a50a6de
Make fewer calls to MercPtrs
Asdow Nov 20, 2024
a9120ef
Remove unused function
Asdow Nov 20, 2024
1ec2867
Use SoldierID
Asdow Nov 20, 2024
0dc2cea
Use SoldierID
Asdow Nov 21, 2024
67c8081
Use SoldierID
Asdow Nov 21, 2024
94f2e83
Lessen repetition
Asdow Nov 21, 2024
d687956
Remove unused function
Asdow Nov 21, 2024
1ac5d15
Correct inc/dec operator overloads
Asdow Nov 21, 2024
0d97e36
Use SoldierID
Asdow Nov 21, 2024
d960403
Use SoldierID
Asdow Nov 21, 2024
24656f2
Use SoldierID
Asdow Nov 30, 2024
d244ef4
use SoldierID
Asdow Nov 30, 2024
4645a09
Use SoldierID
Asdow Nov 30, 2024
66f5156
Use SoldierID
Asdow Nov 30, 2024
5bbbec1
Use SoldierID
Asdow Nov 30, 2024
2eb16c5
Use SoldierID
Asdow Nov 30, 2024
c2b1ac0
use SoldierID
Asdow Nov 30, 2024
79b57c3
Move check for surgery into its own function
Asdow Nov 30, 2024
de56f65
Use SoldierID
Asdow Nov 30, 2024
4e8c5fa
Remove unused function & globals
Asdow Nov 30, 2024
e59d915
Use SoldierID
Asdow Nov 30, 2024
bfb724e
Use SoldierID
Asdow Dec 1, 2024
1013531
Remove #pragma optimize("", off) calls
Asdow Dec 1, 2024
d0dbb9a
Remove unused function
Asdow Dec 1, 2024
abe6877
Delete VS project files
Asdow Dec 1, 2024
ffccdfa
Fix Tactical Placement GUI for increased teamsizes
Asdow Dec 3, 2024
20a3389
Fix Teamlist for smaller resolutions
Asdow Dec 4, 2024
07320ba
Limit TeamList mouseregions to correct amount
Asdow Apr 9, 2025
ec4dc8b
Provide gMapViewRegion through mapscreen.h
Asdow Apr 9, 2025
da3c3ba
Use mouse position for squad movement popup box initial location
Asdow Apr 9, 2025
865288e
Implement multicolumn popupbox
Asdow Apr 13, 2025
36a84ff
Remove pSecondColumnString
Asdow Apr 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Editor/EditorMercs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void AddNewItemToSelectedMercsInventory( BOOLEAN fCreate );
void RenderMercInventoryPanel();
void SetDroppableCheckboxesBasedOnMercsInventory();

extern BOOLEAN InternalAddSoldierToSector( UINT8 ubID, BOOLEAN fCalculateDirection, BOOLEAN fUseAnimation, UINT16 usAnimState, UINT16 usAnimCode );
extern BOOLEAN InternalAddSoldierToSector( SoldierID ubID, BOOLEAN fCalculateDirection, BOOLEAN fUseAnimation, UINT16 usAnimState, UINT16 usAnimCode );

//array which keeps track of which item is in which slot. This is dependant on the selected merc, so
//these temp values must be updated when different mercs are selected, and reset when a merc detailed
Expand Down Expand Up @@ -559,7 +559,7 @@ void AddMercToWorld( INT32 iMapIndex )

if( IsLocationSittable( iMapIndex, gfRoofPlacement ) )
{
UINT8 ubID;
SoldierID ubID;
INT16 sSectorX, sSectorY;
SOLDIERINITNODE *pNode;

Expand Down Expand Up @@ -3783,7 +3783,7 @@ void PasteMercPlacement( INT32 iMapIndex )

if( IsLocationSittable( iMapIndex, gfRoofPlacement ) )
{
UINT8 ubID;
SoldierID ubID;
INT16 sSectorX, sSectorY;
SOLDIERINITNODE *pNode;

Expand Down
3 changes: 2 additions & 1 deletion Ja2/GameVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ extern CHAR16 zBuildInformation[256];
// Keeps track of the saved game version. Increment the saved game version whenever
// you will invalidate the saved game file

#define INCREASED_TEAMSIZES 185 // Asdow: SOLDIERTYPE ubID changed from UINT8 -> UINT16
#define GROWTH_MODIFIERS 184
#define REBELCOMMAND 183
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
Expand Down Expand Up @@ -105,7 +106,7 @@ extern CHAR16 zBuildInformation[256];
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system

#define SAVE_GAME_VERSION GROWTH_MODIFIERS
#define SAVE_GAME_VERSION INCREASED_TEAMSIZES

//#define RUSSIANGOLD
#ifdef __cplusplus
Expand Down
369 changes: 111 additions & 258 deletions Ja2/SaveLoadGame.cpp

Large diffs are not rendered by default.

53 changes: 20 additions & 33 deletions Ja2/SaveLoadGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,45 +38,32 @@ class SOLDIERTYPE;

typedef struct
{
UINT32 uiSavedGameVersion;
CHAR8 zGameVersionNumber[ GAME_VERSION_LENGTH ];

CHAR16 sSavedGameDesc[ SIZE_OF_SAVE_GAME_DESC ];

UINT32 uiFlags;

UINT32 uiSavedGameVersion;
CHAR8 zGameVersionNumber[ GAME_VERSION_LENGTH ];
CHAR16 sSavedGameDesc[ SIZE_OF_SAVE_GAME_DESC ];
UINT32 uiFlags;
#ifdef CRIPPLED_VERSION
UINT8 ubCrippleFiller[20];
UINT8 ubCrippleFiller[20];
#endif


//The following will be used to quickly access info to display in the save/load screen
UINT32 uiDay;
UINT8 ubHour;
UINT8 ubMin;
INT16 sSectorX;
INT16 sSectorY;
INT8 bSectorZ;
UINT8 ubNumOfMercsOnPlayersTeam;
INT32 iCurrentBalance;

UINT32 uiCurrentScreen;

BOOLEAN fAlternateSector;

BOOLEAN fWorldLoaded;

UINT8 ubLoadScreenID; //The load screen that should be used when loading the saved game

GAME_OPTIONS sInitialGameOptions; //need these in the header so we can get the info from it on the save load screen.

UINT32 uiRandom;

UINT8 ubFiller[500]; // WANNE: Decrease this filler by 1, for each new UINT8 variable!
UINT32 uiDay;
UINT8 ubHour;
UINT8 ubMin;
INT16 sSectorX;
INT16 sSectorY;
INT8 bSectorZ;
UINT16 ubNumOfMercsOnPlayersTeam;
INT32 iCurrentBalance;
UINT32 uiCurrentScreen;
BOOLEAN fAlternateSector;
BOOLEAN fWorldLoaded;
UINT8 ubLoadScreenID; //The load screen that should be used when loading the saved game
GAME_OPTIONS sInitialGameOptions; //need these in the header so we can get the info from it on the save load screen.
UINT32 uiRandom;
UINT8 ubFiller[494]; // WANNE: Decrease this filler by 1, for each new UINT8 variable!

} SAVED_GAME_HEADER;


extern UINT32 guiScreenToGotoAfterLoadingSavedGame;
extern UINT32 guiCurrentSaveGameVersion;

Expand Down
2 changes: 1 addition & 1 deletion Ja2/aniviewscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ UINT32 AniEditScreenHandle(void)
fToggle2 = FALSE;
ubCurLoadedState = 0;

pSoldier = MercPtrs[ gusSelectedSoldier ];
pSoldier = gusSelectedSoldier;

gTacticalStatus.uiFlags |= LOADING_SAVED_GAME;

Expand Down
4 changes: 3 additions & 1 deletion Ja2/builddefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
// -----------------------------

// Map Editor version - you should use the MapEditor configuration instead of messing with these defines (ChrisL)
//#define JA2BETAVERSION
#ifndef JA2BETAVERSION
#define JA2BETAVERSION
#endif
//#define JA2EDITOR
// Normal test version
//#define JA2TESTVERSION
Expand Down
64 changes: 28 additions & 36 deletions Ja2/gamescreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ INT32 giCounterPeriodOverlay = 0;
BOOLEAN gfExitToNewSector = FALSE;
//UINT8 gubNewSectorExitDirection;

BOOLEAN gfGameScreenLocateToSoldier = FALSE;
BOOLEAN gfEnteringMapScreen = FALSE;
UINT32 uiOldMouseCursor;
UINT8 gubPreferredInitialSelectedGuy = NOBODY;
BOOLEAN gfGameScreenLocateToSoldier = FALSE;
BOOLEAN gfEnteringMapScreen = FALSE;
UINT32 uiOldMouseCursor;
SoldierID gubPreferredInitialSelectedGuy = NOBODY;

BOOLEAN gfTacticalIsModal = FALSE;
MOUSE_REGION gTacticalDisableRegion;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -580,9 +580,9 @@ UINT32 MainGameScreenHandle(void)
{
if ( gTacticalStatus.ubCurrentTeam != gbPlayerNum )
{
MercPtrs[ gTacticalStatus.ubEnemySightingOnTheirTurnEnemyID ]->AdjustNoAPToFinishMove( FALSE );
gTacticalStatus.ubEnemySightingOnTheirTurnEnemyID->AdjustNoAPToFinishMove( FALSE );
}
MercPtrs[ gTacticalStatus.ubEnemySightingOnTheirTurnEnemyID ]->flags.fPauseAllAnimation = FALSE;
gTacticalStatus.ubEnemySightingOnTheirTurnEnemyID->flags.fPauseAllAnimation = FALSE;

gTacticalStatus.fEnemySightingOnTheirTurn = FALSE;
}
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -735,11 +735,11 @@ UINT32 MainGameScreenHandle(void)

if ( !ARE_IN_FADE_IN( ) )
{
HandleAutoBandagePending( );
HandleAutoBandagePending( );

#ifdef JA2UB
HandleThePlayerBeNotifiedOfSomeoneElseInSector();
#endif
#ifdef JA2UB
HandleThePlayerBeNotifiedOfSomeoneElseInSector();
#endif
}


Expand Down Expand Up @@ -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 );
}
}

Expand Down Expand Up @@ -1030,15 +1030,12 @@ void DisableFPSOverlay( BOOLEAN fEnable )

void TacticalScreenLocateToSoldier( )
{
INT32 cnt;
SOLDIERTYPE *pSoldier;
INT16 bLastTeamID;
BOOLEAN fPreferedGuyUsed = FALSE;
BOOLEAN fPreferedGuyUsed = FALSE;

if ( gubPreferredInitialSelectedGuy != NOBODY )
{
// ATE: Put condition here...
if ( OK_CONTROLLABLE_MERC( MercPtrs[ gubPreferredInitialSelectedGuy ] ) && OK_INTERRUPT_MERC( MercPtrs[ gubPreferredInitialSelectedGuy ] ) )
if ( OK_CONTROLLABLE_MERC( gubPreferredInitialSelectedGuy ) && OK_INTERRUPT_MERC( gubPreferredInitialSelectedGuy ) )
{
LocateSoldier( gubPreferredInitialSelectedGuy, 10 );
SelectSoldier( gubPreferredInitialSelectedGuy, FALSE, TRUE );
Expand All @@ -1050,14 +1047,14 @@ void TacticalScreenLocateToSoldier( )
if ( !fPreferedGuyUsed )
{
// Set locator to first merc
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
for ( pSoldier = MercPtrs[ cnt ]; cnt <= bLastTeamID; cnt++,pSoldier++)
SoldierID Soldier = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
SoldierID bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
for ( ; Soldier <= bLastTeamID; ++Soldier)
{
if ( OK_CONTROLLABLE_MERC( pSoldier ) && OK_INTERRUPT_MERC( pSoldier ) )
if ( OK_CONTROLLABLE_MERC( Soldier ) && OK_INTERRUPT_MERC( Soldier ) )
{
LocateSoldier( pSoldier->ubID, 10 );
SelectSoldier( pSoldier->ubID, FALSE, TRUE );
LocateSoldier( Soldier, 10 );
SelectSoldier( Soldier, FALSE, TRUE );
break;
}
}
Expand All @@ -1075,22 +1072,17 @@ void EnterMapScreen( )

void UpdateTeamPanelAssignments( )
{
INT32 cnt;
SOLDIERTYPE *pSoldier;
INT16 bLastTeamID;

// Remove all players
RemoveAllPlayersFromSlot( );

// Set locator to first merc
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
for ( pSoldier = MercPtrs[ cnt ]; cnt <= bLastTeamID; cnt++,pSoldier++)
SoldierID Soldier = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
SoldierID bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
for ( ; Soldier <= bLastTeamID; ++Soldier)
{
// Setup team interface
CheckForAndAddMercToTeamPanel( pSoldier );
CheckForAndAddMercToTeamPanel( Soldier );
}

}


Expand Down
10 changes: 5 additions & 5 deletions Ja2/gamescreen.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _GAMESCREEN_H
#define _GAMESCREEN_H


#include "Overhead Types.h"
#include "fade screen.h"

#define ARE_IN_FADE_IN( ) ( gfFadeIn || gfFadeInitialized )
Expand All @@ -14,9 +14,9 @@ void FadeOutGameScreen( );
typedef void (*MODAL_HOOK)( void );


extern BOOLEAN gfGameScreenLocateToSoldier;
extern BOOLEAN gfEnteringMapScreen;
extern UINT8 gubPreferredInitialSelectedGuy;
extern BOOLEAN gfGameScreenLocateToSoldier;
extern BOOLEAN gfEnteringMapScreen;
extern SoldierID gubPreferredInitialSelectedGuy;


void EnterMapScreen( );
Expand All @@ -41,4 +41,4 @@ void InitHelicopterEntranceByMercs( void );

void InternalLeaveTacticalScreen( UINT32 uiNewScreen );

#endif
#endif
46 changes: 15 additions & 31 deletions Ja2/jascreens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

if ( gusSelectedSoldier == NOBODY )
SOLDIERTYPE *pSoldier;
UINT32 cnt;
UINT8 ubType;
UINT8 ubPaletteRep;
UINT8 ubStartRep = 0;
UINT8 ubEndRep = 0;

if ( gusSelectedSoldier >= NOBODY || gusSelectedSoldier->bActive == FALSE )
{
return( FALSE );
}
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Loading