@@ -1945,34 +1945,30 @@ void MovableMan::Update()
1945
1945
1946
1946
// SETTLE PARTICLES //////////////////////////////////////////////////
1947
1947
// Only settle after all updates and deletions are done
1948
- if (m_SettlingEnabled)
1949
- {
1950
- parIt = partition (m_Particles.begin (), m_Particles.end (), std::not_fn (std::mem_fn (&MovableObject::ToSettle)));
1951
- midIt = parIt;
1952
-
1953
- while (parIt != m_Particles.end ())
1954
- {
1955
- Vector parPos ((*parIt)->GetPos ().GetFloored ());
1956
- Material const * terrMat = g_SceneMan.GetMaterialFromID (g_SceneMan.GetTerrain ()->GetMaterialPixel (parPos.m_X , parPos.m_Y ));
1957
- if ((*parIt)->GetDrawPriority () >= terrMat->GetPriority ()) {
1958
- int piling = (*parIt)->GetMaterial ()->GetPiling ();
1959
- if (piling >= 0 ) {
1960
- for (int s = 0 ; terrMat->GetIndex () == (*parIt)->GetMaterial ()->GetIndex () && s < piling; ++s) {
1961
- if (s % 2 == 0 ) {
1962
- parPos.m_Y -= 1 .0F ;
1963
- } else {
1964
- parPos.m_X += (RandomNum () >= 0 .5F ? 1 .0F : -1 .0F );
1965
- }
1966
- terrMat = g_SceneMan.GetMaterialFromID (g_SceneMan.GetTerrain ()->GetMaterialPixel (parPos.m_X , parPos.m_Y ));
1948
+ if (m_SettlingEnabled) {
1949
+ parIt = partition (m_Particles.begin (), m_Particles.end (), std::not_fn (std::mem_fn (&MovableObject::ToSettle)));
1950
+ midIt = parIt;
1951
+
1952
+ while (parIt != m_Particles.end ()) {
1953
+ Vector parPos ((*parIt)->GetPos ());
1954
+ Material const * terrMat = g_SceneMan.GetMaterialFromID (g_SceneMan.GetTerrain ()->GetMaterialPixel (parPos.GetFloorIntX (), parPos.GetFloorIntY ()));
1955
+ int piling = (*parIt)->GetMaterial ()->GetPiling ();
1956
+ if (piling > 0 ) {
1957
+ for (int s = 0 ; terrMat->GetIndex () == (*parIt)->GetMaterial ()->GetIndex () && s < piling; ++s) {
1958
+ if ((piling - s) % 2 == 0 ) {
1959
+ parPos.m_Y -= 1 .0F ;
1960
+ } else {
1961
+ parPos.m_X += (RandomNum () >= 0 .5F ? 1 .0F : -1 .0F );
1967
1962
}
1968
- (*parIt )->SetPos (parPos);
1963
+ terrMat = g_SceneMan. GetMaterialFromID (g_SceneMan. GetTerrain ( )->GetMaterialPixel (parPos. GetFloorIntX (), parPos. GetFloorIntY ()) );
1969
1964
}
1970
- g_SceneMan. GetTerrain ( )->ApplyMovableObject (*parIt );
1965
+ (*parIt )->SetPos (parPos. GetFloored () );
1971
1966
}
1972
- delete *(parIt++);
1973
- }
1974
- m_Particles.erase (midIt, m_Particles.end ());
1975
- }
1967
+ if ((*parIt)->GetDrawPriority () >= terrMat->GetPriority ()) { g_SceneMan.GetTerrain ()->ApplyMovableObject (*parIt); }
1968
+ delete *(parIt++);
1969
+ }
1970
+ m_Particles.erase (midIt, m_Particles.end ());
1971
+ }
1976
1972
1977
1973
release_bitmap (g_SceneMan.GetTerrain ()->GetMaterialBitmap ());
1978
1974
0 commit comments