Skip to content

Commit 806e940

Browse files
authored
[GEN][ZH] Fix missing unit voice when attacking the ground (#1156)
1 parent 9744c15 commit 806e940

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -422,20 +422,6 @@ void pickAndPlayUnitVoiceResponse( const DrawableList *list, GameMessage::Type m
422422
break;
423423
}
424424

425-
case GameMessage::MSG_DO_FORCE_ATTACK_GROUND:
426-
{
427-
soundToPlayPtr = templ->getPerUnitSound( "VoiceBombard" );
428-
objectWithSound = obj;
429-
skip = true;
430-
431-
if (TheAudio->isValidAudioEvent(soundToPlayPtr)) {
432-
break;
433-
} else {
434-
// clear out the sound to play, and drop into the attack object logic.
435-
soundToPlayPtr = NULL;
436-
}
437-
}
438-
439425
case GameMessage::MSG_SWITCH_WEAPONS:
440426
{
441427
if( info && info->m_weaponSlot )
@@ -457,7 +443,21 @@ void pickAndPlayUnitVoiceResponse( const DrawableList *list, GameMessage::Type m
457443
}
458444
break;
459445
}
460-
446+
447+
case GameMessage::MSG_DO_FORCE_ATTACK_GROUND:
448+
{
449+
soundToPlayPtr = templ->getPerUnitSound( "VoiceBombard" );
450+
objectWithSound = obj;
451+
skip = true;
452+
453+
if (TheAudio->isValidAudioEvent(soundToPlayPtr)) {
454+
break;
455+
} else {
456+
// clear out the sound to play, and drop into the attack object logic.
457+
soundToPlayPtr = NULL;
458+
FALLTHROUGH;
459+
}
460+
}
461461
case GameMessage::MSG_DO_FORCE_ATTACK_OBJECT:
462462
case GameMessage::MSG_DO_ATTACK_OBJECT:
463463
case GameMessage::MSG_DO_WEAPON_AT_OBJECT:

GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -481,20 +481,6 @@ void pickAndPlayUnitVoiceResponse( const DrawableList *list, GameMessage::Type m
481481
break;
482482
}
483483

484-
case GameMessage::MSG_DO_FORCE_ATTACK_GROUND:
485-
{
486-
soundToPlayPtr = templ->getPerUnitSound( "VoiceBombard" );
487-
objectWithSound = obj;
488-
skip = true;
489-
490-
if (TheAudio->isValidAudioEvent(soundToPlayPtr)) {
491-
break;
492-
} else {
493-
// clear out the sound to play, and drop into the attack object logic.
494-
soundToPlayPtr = NULL;
495-
}
496-
}
497-
498484
case GameMessage::MSG_SWITCH_WEAPONS:
499485
{
500486
if( info && info->m_weaponSlot )
@@ -516,7 +502,21 @@ void pickAndPlayUnitVoiceResponse( const DrawableList *list, GameMessage::Type m
516502
}
517503
break;
518504
}
519-
505+
506+
case GameMessage::MSG_DO_FORCE_ATTACK_GROUND:
507+
{
508+
soundToPlayPtr = templ->getPerUnitSound( "VoiceBombard" );
509+
objectWithSound = obj;
510+
skip = true;
511+
512+
if (TheAudio->isValidAudioEvent(soundToPlayPtr)) {
513+
break;
514+
} else {
515+
// clear out the sound to play, and drop into the attack object logic.
516+
soundToPlayPtr = NULL;
517+
FALLTHROUGH;
518+
}
519+
}
520520
case GameMessage::MSG_DO_FORCE_ATTACK_OBJECT:
521521
case GameMessage::MSG_DO_ATTACK_OBJECT:
522522
case GameMessage::MSG_DO_WEAPON_AT_OBJECT:

0 commit comments

Comments
 (0)