Store the profile type in the profile structure and remove superfluous code

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8620 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2018-09-24 19:36:28 +00:00
parent 8ae2eacfcd
commit 494dbc6e69
41 changed files with 385 additions and 942 deletions
+12 -11
View File
@@ -36,15 +36,16 @@
void InitializeProfilesForTownReputation( void )
{
UINT32 uiProfileId = 0;
// initialize the town opinion values in each recruitable merc's profile structure
//for( uiProfileId = 0; uiProfileId < FIRST_NPC; uiProfileId++ )
//new profiles by Jazz
for( uiProfileId = 0; uiProfileId < NUM_PROFILES; uiProfileId++ )
for( UINT32 uiProfileId = 0; uiProfileId < NUM_PROFILES; ++uiProfileId )
{
if ( gProfilesIMP[uiProfileId].ProfilId == uiProfileId || gProfilesRPC[uiProfileId].ProfilId == uiProfileId || gProfilesAIM[uiProfileId].ProfilId == uiProfileId || gProfilesMERC[uiProfileId].ProfilId == uiProfileId)
memset( &( gMercProfiles[ uiProfileId ].bMercTownReputation ), INITIAL_TOWN_REPUTATION, sizeof( gMercProfiles[ uiProfileId ].bMercTownReputation ) );
if ( gMercProfiles[uiProfileId].Type == PROFILETYPE_AIM ||
gMercProfiles[uiProfileId].Type == PROFILETYPE_MERC ||
gMercProfiles[uiProfileId].Type == PROFILETYPE_RPC ||
gMercProfiles[uiProfileId].Type == PROFILETYPE_IMP )
memset( &( gMercProfiles[ uiProfileId ].bMercTownReputation ), INITIAL_TOWN_REPUTATION, sizeof( gMercProfiles[ uiProfileId ].bMercTownReputation ) );
}
}
@@ -131,22 +132,22 @@ void UpdateTownOpinionOfThisMercForSoldier( SOLDIERTYPE *pSoldier, UINT8 ubTownI
void HandleSpreadOfAllTownsOpinion( void )
{
UINT8 ubProfileId;
// debug message
ScreenMsg( MSG_FONT_RED, MSG_DEBUG, L"%s - Spreading town opinions about mercs", WORLDTIMESTR );
// run though all player-recruitable profiles and update towns opinion of mercs
//for( ubProfileId = 0; ubProfileId < FIRST_NPC; ubProfileId++ )
//new profiles by Jazz
for( ubProfileId = 0; ubProfileId < NUM_PROFILES; ubProfileId++ )
for( int ubProfileId = 0; ubProfileId < NUM_PROFILES; ++ubProfileId )
{
if ( gProfilesIMP[ubProfileId].ProfilId == ubProfileId || gProfilesAIM[ubProfileId].ProfilId == ubProfileId || gProfilesMERC[ubProfileId].ProfilId == ubProfileId || gProfilesRPC[ubProfileId].ProfilId == ubProfileId)
HandleSpreadOfTownOpinionForMerc( ubProfileId );
if ( gMercProfiles[ubProfileId].Type == PROFILETYPE_AIM ||
gMercProfiles[ubProfileId].Type == PROFILETYPE_MERC ||
gMercProfiles[ubProfileId].Type == PROFILETYPE_RPC ||
gMercProfiles[ubProfileId].Type == PROFILETYPE_IMP )
HandleSpreadOfTownOpinionForMerc( ubProfileId );
}
}
void HandleSpreadOfTownOpinionForMerc( UINT8 ubProfileId )
{
// handle opinion spread for this grunt