Skip to content

Commit 5c79737

Browse files
committed
add ambient sound toggle
1 parent 45c25bc commit 5c79737

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/DroneCarrierContain.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ void DroneCarrierContain::onRemoving(Object* rider)
124124
rider->clearWeaponBonusCondition(WEAPONBONUSCONDITION_CONTAINED);
125125
rider->clearWeaponSetFlag(WEAPONSET_CONTAINED);
126126

127+
Drawable* rider_draw = rider->getDrawable();
128+
if (rider_draw != nullptr) {
129+
rider_draw->enableAmbientSound(true);
130+
}
131+
127132
// If we have a bone and no exit paths, put each rider at the numbered bone position
128133
if (!d->m_exitBone.isEmpty() && d->m_numberOfExitPaths <= 0)
129134
{
@@ -243,6 +248,11 @@ void DroneCarrierContain::onContaining(Object* obj, Bool wasSelected)
243248
{
244249
TransportContain::onContaining(obj, wasSelected);
245250

251+
Drawable* draw = obj->getDrawable();
252+
if (draw != nullptr) {
253+
draw->enableAmbientSound(false);
254+
}
255+
246256
// Assing in first free slot
247257
for (size_t i = 0; i < m_contained_units.size(); i++) {
248258
if (std::get<0>(m_contained_units[i]) == INVALID_ID) {

0 commit comments

Comments
 (0)