Permalink
Browse files

Small cleanup for object donation.

Do not play audio for campaign gifting since it could get very noisy
when donating, especially a large amount of objects, to the player.
  • Loading branch information...
KJeff01 committed Jan 12, 2018
1 parent 5799957 commit ac46aefab9f6eaf8e215af3c7847ab64fdcaa79e
Showing with 5 additions and 24 deletions.
  1. +2 −2 src/multigifts.cpp
  2. +3 −22 src/structure.cpp
View
@@ -122,8 +122,8 @@ bool recvGift(NETQUEUE queue)
break;
}
// If we are on the receiving end play an audio alert
if (to == selectedPlayer)
// If we are on the receiving end play an audio alert.
if (bMultiPlayer && to == selectedPlayer)
{
audio_QueueTrack(audioTrack);
}
View
@@ -6807,8 +6807,7 @@ STRUCTURE *giftSingleStructure(STRUCTURE *psStructure, UBYTE attackPlayer, bool
}
//check through the 'attackPlayer' players list of structures to see if any are targetting it
for (psStruct = apsStructLists[attackPlayer]; psStruct != nullptr; psStruct =
psStruct->psNext)
for (psStruct = apsStructLists[attackPlayer]; psStruct != nullptr; psStruct = psStruct->psNext)
{
if (psStruct->psTarget[0] == psStructure)
{
@@ -6861,16 +6860,14 @@ STRUCTURE *giftSingleStructure(STRUCTURE *psStructure, UBYTE attackPlayer, bool
case REF_POWER_GEN:
case REF_RESEARCH:
//build the module for powerGen and research
buildStructure(psModule, psNewStruct->pos.x, psNewStruct->pos.y,
attackPlayer, false);
buildStructure(psModule, psNewStruct->pos.x, psNewStruct->pos.y, attackPlayer, false);
break;
case REF_FACTORY:
case REF_VTOL_FACTORY:
//build the appropriate number of modules
while (capacity)
{
buildStructure(psModule, psNewStruct->pos.x, psNewStruct->pos.y,
attackPlayer, false);
buildStructure(psModule, psNewStruct->pos.x, psNewStruct->pos.y, attackPlayer, false);
capacity--;
}
break;
@@ -6891,25 +6888,9 @@ STRUCTURE *giftSingleStructure(STRUCTURE *psStructure, UBYTE attackPlayer, bool
}
if (!bMultiPlayer)
{
//inform selectedPlayer that takeover has happened
if (originalPlayer == selectedPlayer)
{
if (wallDefenceStruct(psNewStruct->pStructureType))
{
audio_QueueTrackPos(ID_SOUND_NEXUS_DEFENCES_ABSORBED,
psNewStruct->pos.x, psNewStruct->pos.y, psNewStruct->pos.z);
}
else
{
audio_QueueTrackPos(ID_SOUND_NEXUS_STRUCTURE_ABSORBED,
psNewStruct->pos.x, psNewStruct->pos.y, psNewStruct->pos.z);
}
//make sure this structure is visible to selectedPlayer if the structure used to be selectedPlayers'
psNewStruct->visible[selectedPlayer] = UBYTE_MAX;
}

0 comments on commit ac46aef

Please sign in to comment.