Multiplayer Bugfix:

- Fixed problems after hosting game in strategy screen (crashes, options not clickable, ...)
o The problems seems to be the reworked taunts initialization from revision 6640. I did not trace down the exact problem, but taunts should anyway be disabled in a multiplayer game
o Now taunts are disabled in a multiplayer game which fixes the above problems

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6648 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-11-25 08:45:50 +00:00
parent 376b174d5b
commit 8e4c2b74c1
3 changed files with 57 additions and 43 deletions
+4
View File
@@ -1017,7 +1017,10 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
} }
#endif #endif
// WANNE: Only in a singleplayer game...
// Externalised taunts // Externalised taunts
if (!is_networked)
{
GETFILESTRUCT FileInfo; GETFILESTRUCT FileInfo;
char tauntFileNamePattern[MAX_PATH]; char tauntFileNamePattern[MAX_PATH];
strcpy(tauntFileNamePattern, directoryName); strcpy(tauntFileNamePattern, directoryName);
@@ -1053,6 +1056,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
} }
GetFileClose(&FileInfo); GetFileClose(&FileInfo);
} }
}
// IMP Portraits List by Jazz // IMP Portraits List by Jazz
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
+3
View File
@@ -1049,6 +1049,9 @@ BOOLEAN LoadCivQuotesFromLoadGameFile( HWFILE hFile )
// anv: start enemy taunt with probabilty depending on taunt settings // anv: start enemy taunt with probabilty depending on taunt settings
void PossiblyStartEnemyTaunt( SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, SOLDIERTYPE *pTarget ) void PossiblyStartEnemyTaunt( SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, SOLDIERTYPE *pTarget )
{ {
if (is_networked) // No taunts in multiplayer
return;
// taunts disabled? // taunts disabled?
if( gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] == FALSE ) if( gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] == FALSE )
{ {
+7
View File
@@ -1708,6 +1708,9 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
case AI_ACTION_LEAVE_WATER_GAS: // seek nearest spot of ungassed land case AI_ACTION_LEAVE_WATER_GAS: // seek nearest spot of ungassed land
case AI_ACTION_SEEK_NOISE: // seek most important noise heard case AI_ACTION_SEEK_NOISE: // seek most important noise heard
case AI_ACTION_RUN_AWAY: // run away from nearby opponent(s) case AI_ACTION_RUN_AWAY: // run away from nearby opponent(s)
if (!is_networked)
{
// SANDRO - ENEMY TAUNTS // SANDRO - ENEMY TAUNTS
if (gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] == TRUE && if (gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] == TRUE &&
( ( pSoldier->bTeam == ENEMY_TEAM && SOLDIER_CLASS_ENEMY( pSoldier->ubSoldierClass ) && pSoldier->bVisible != -1 ) || ( ( pSoldier->bTeam == ENEMY_TEAM && SOLDIER_CLASS_ENEMY( pSoldier->ubSoldierClass ) && pSoldier->bVisible != -1 ) ||
@@ -1726,6 +1729,7 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
} }
#endif #endif
} }
}
case AI_ACTION_APPROACH_MERC: // walk up to someone to talk case AI_ACTION_APPROACH_MERC: // walk up to someone to talk
case AI_ACTION_TRACK: // track by ground scent case AI_ACTION_TRACK: // track by ground scent
case AI_ACTION_EAT: // monster approaching corpse case AI_ACTION_EAT: // monster approaching corpse
@@ -1955,11 +1959,14 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
} }
// CC, ATE here - I put in some TEMP randomness... // CC, ATE here - I put in some TEMP randomness...
if (!is_networked)
{
if ( Random( 50 ) == 0 && gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] == FALSE && if ( Random( 50 ) == 0 && gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] == FALSE &&
IS_MERC_BODY_TYPE( pSoldier ) && pSoldier->ubProfile == NO_PROFILE && pSoldier->bVisible != -1) IS_MERC_BODY_TYPE( pSoldier ) && pSoldier->ubProfile == NO_PROFILE && pSoldier->bVisible != -1)
{ {
StartCivQuote( pSoldier ); StartCivQuote( pSoldier );
} }
}
#ifdef RECORDNET #ifdef RECORDNET
fprintf(NetDebugFile,"\tExecuteAction: %d calling HandleItem(), inHand %d, actionData %d, anitype %d, oldani %d\n", fprintf(NetDebugFile,"\tExecuteAction: %d calling HandleItem(), inHand %d, actionData %d, anitype %d, oldani %d\n",
pSoldier->ubID,pSoldier->inv[HANDPOS].item,pSoldier->aiData.usActionData,pSoldier->anitype[pSoldier->anim],pSoldier->oldani); pSoldier->ubID,pSoldier->inv[HANDPOS].item,pSoldier->aiData.usActionData,pSoldier->anitype[pSoldier->anim],pSoldier->oldani);