mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 01:24:18 +00:00
Fix deleting envelopes not updating sounds
This commit is contained in:
parent
c33e0c124e
commit
52b717f848
|
@ -6190,6 +6190,21 @@ void CEditorMap::DeleteEnvelope(int Index)
|
||||||
if(pLayerTiles->m_ColorEnv > Index)
|
if(pLayerTiles->m_ColorEnv > Index)
|
||||||
pLayerTiles->m_ColorEnv--;
|
pLayerTiles->m_ColorEnv--;
|
||||||
}
|
}
|
||||||
|
else if(pLayer->m_Type == LAYERTYPE_SOUNDS)
|
||||||
|
{
|
||||||
|
CLayerSounds *pLayerSounds = static_cast<CLayerSounds *>(pLayer);
|
||||||
|
for(auto &Source : pLayerSounds->m_lSources)
|
||||||
|
{
|
||||||
|
if(Source.m_PosEnv == Index)
|
||||||
|
Source.m_PosEnv = -1;
|
||||||
|
else if(Source.m_PosEnv > Index)
|
||||||
|
Source.m_PosEnv--;
|
||||||
|
if(Source.m_SoundEnv == Index)
|
||||||
|
Source.m_SoundEnv = -1;
|
||||||
|
else if(Source.m_SoundEnv > Index)
|
||||||
|
Source.m_SoundEnv--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_lEnvelopes.erase(m_lEnvelopes.begin() + Index);
|
m_lEnvelopes.erase(m_lEnvelopes.begin() + Index);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue