mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
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:
@@ -1017,41 +1017,45 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// WANNE: Only in a singleplayer game...
|
||||||
// Externalised taunts
|
// Externalised taunts
|
||||||
GETFILESTRUCT FileInfo;
|
if (!is_networked)
|
||||||
char tauntFileNamePattern[MAX_PATH];
|
|
||||||
strcpy(tauntFileNamePattern, directoryName);
|
|
||||||
strcat(tauntFileNamePattern, TAUNTSFILENAMEBEGINNING"*"TAUNTSFILENAMEENDING);
|
|
||||||
if( GetFileFirst(tauntFileNamePattern, &FileInfo) )
|
|
||||||
{
|
{
|
||||||
strcpy(fileName, directoryName);
|
GETFILESTRUCT FileInfo;
|
||||||
strcat(fileName, FileInfo.zFileName);
|
char tauntFileNamePattern[MAX_PATH];
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
strcpy(tauntFileNamePattern, directoryName);
|
||||||
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
|
strcat(tauntFileNamePattern, TAUNTSFILENAMEBEGINNING"*"TAUNTSFILENAMEENDING);
|
||||||
#ifndef ENGLISH
|
if( GetFileFirst(tauntFileNamePattern, &FileInfo) )
|
||||||
AddLanguagePrefix(fileName);
|
|
||||||
if ( FileExists(fileName) )
|
|
||||||
{
|
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
|
||||||
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
while( GetFileNext(&FileInfo) )
|
|
||||||
{
|
{
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, FileInfo.zFileName);
|
strcat(fileName, FileInfo.zFileName);
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
|
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
|
||||||
#ifndef ENGLISH
|
#ifndef ENGLISH
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
while( GetFileNext(&FileInfo) )
|
||||||
|
{
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, FileInfo.zFileName);
|
||||||
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
|
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
|
||||||
|
#ifndef ENGLISH
|
||||||
|
AddLanguagePrefix(fileName);
|
||||||
|
if ( FileExists(fileName) )
|
||||||
|
{
|
||||||
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
|
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
GetFileClose(&FileInfo);
|
||||||
}
|
}
|
||||||
GetFileClose(&FileInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// IMP Portraits List by Jazz
|
// IMP Portraits List by Jazz
|
||||||
|
|||||||
@@ -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 )
|
||||||
{
|
{
|
||||||
|
|||||||
+29
-22
@@ -1708,24 +1708,28 @@ 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)
|
||||||
// SANDRO - ENEMY TAUNTS
|
|
||||||
if (gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] == TRUE &&
|
|
||||||
( ( pSoldier->bTeam == ENEMY_TEAM && SOLDIER_CLASS_ENEMY( pSoldier->ubSoldierClass ) && pSoldier->bVisible != -1 ) ||
|
|
||||||
( pSoldier->bTeam == MILITIA_TEAM && SOLDIER_CLASS_MILITIA( pSoldier->ubSoldierClass ) && pSoldier->bVisible != -1 ) ) )
|
|
||||||
{
|
|
||||||
if (pSoldier->aiData.bAction == AI_ACTION_SEEK_NOISE )
|
|
||||||
PossiblyStartEnemyTaunt( pSoldier, TAUNT_SEEK_NOISE );
|
|
||||||
else if (pSoldier->aiData.bAction == AI_ACTION_RUN_AWAY )
|
|
||||||
PossiblyStartEnemyTaunt( pSoldier, TAUNT_RUN_AWAY );
|
|
||||||
#ifdef ENABLE_ZOMBIES
|
|
||||||
if ( Random( 5 ) == 0 )
|
|
||||||
{
|
|
||||||
if ( pSoldier->IsZombie() ) // Madd: Zombies randomly moan...
|
|
||||||
pSoldier->DoMercBattleSound( (INT8)( BATTLE_SOUND_LAUGH1 ) );
|
|
||||||
|
|
||||||
}
|
if (!is_networked)
|
||||||
#endif
|
{
|
||||||
}
|
// SANDRO - ENEMY TAUNTS
|
||||||
|
if (gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] == TRUE &&
|
||||||
|
( ( pSoldier->bTeam == ENEMY_TEAM && SOLDIER_CLASS_ENEMY( pSoldier->ubSoldierClass ) && pSoldier->bVisible != -1 ) ||
|
||||||
|
( pSoldier->bTeam == MILITIA_TEAM && SOLDIER_CLASS_MILITIA( pSoldier->ubSoldierClass ) && pSoldier->bVisible != -1 ) ) )
|
||||||
|
{
|
||||||
|
if (pSoldier->aiData.bAction == AI_ACTION_SEEK_NOISE )
|
||||||
|
PossiblyStartEnemyTaunt( pSoldier, TAUNT_SEEK_NOISE );
|
||||||
|
else if (pSoldier->aiData.bAction == AI_ACTION_RUN_AWAY )
|
||||||
|
PossiblyStartEnemyTaunt( pSoldier, TAUNT_RUN_AWAY );
|
||||||
|
#ifdef ENABLE_ZOMBIES
|
||||||
|
if ( Random( 5 ) == 0 )
|
||||||
|
{
|
||||||
|
if ( pSoldier->IsZombie() ) // Madd: Zombies randomly moan...
|
||||||
|
pSoldier->DoMercBattleSound( (INT8)( BATTLE_SOUND_LAUGH1 ) );
|
||||||
|
|
||||||
|
}
|
||||||
|
#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 ( Random( 50 ) == 0 && gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] == FALSE &&
|
if (!is_networked)
|
||||||
IS_MERC_BODY_TYPE( pSoldier ) && pSoldier->ubProfile == NO_PROFILE && pSoldier->bVisible != -1)
|
{
|
||||||
{
|
if ( Random( 50 ) == 0 && gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] == FALSE &&
|
||||||
StartCivQuote( pSoldier );
|
IS_MERC_BODY_TYPE( pSoldier ) && pSoldier->ubProfile == NO_PROFILE && pSoldier->bVisible != -1)
|
||||||
}
|
{
|
||||||
|
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user