From 0b0ba49abc34315f532f9adcdbc277d5275723c7 Mon Sep 17 00:00:00 2001 From: aap Date: Tue, 19 May 2020 21:42:55 +0200 Subject: small fixes --- src/peds/Population.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'src/peds/Population.cpp') diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp index 1566ba3d..e2257a28 100644 --- a/src/peds/Population.cpp +++ b/src/peds/Population.cpp @@ -966,18 +966,11 @@ CPopulation::ConvertToRealObject(CDummyObject *dummy) if (!obj) return; - bool makeInvisible; CWorld::Remove(dummy); delete dummy; CWorld::Add(obj); - int16 mi = obj->GetModelIndex(); - if (mi == MI_GLASS1 || mi == MI_GLASS2 || mi == MI_GLASS3 || mi == MI_GLASS4 || - mi == MI_GLASS5 || mi == MI_GLASS6 || mi == MI_GLASS7 || mi == MI_GLASS8) - makeInvisible = true; - else - makeInvisible = false; - if (makeInvisible) { + if (IsGlass(obj->GetModelIndex())) { obj->bIsVisible = false; } else if (obj->GetModelIndex() == MI_BUOY) { obj->bIsStatic = false; @@ -996,17 +989,8 @@ CPopulation::ConvertToDummyObject(CObject *obj) dummy->GetMatrix().UpdateRW(); dummy->UpdateRwFrame(); - bool makeInvisible; - int16 mi = obj->GetModelIndex(); - if (mi == MI_GLASS1 || mi == MI_GLASS2 || mi == MI_GLASS3 || mi == MI_GLASS4 || - mi == MI_GLASS5 || mi == MI_GLASS6 || mi == MI_GLASS7 || mi == MI_GLASS8) - makeInvisible = true; - else - makeInvisible = false; - - if (makeInvisible) { + if (IsGlass(obj->GetModelIndex())) dummy->bIsVisible = false; - } CWorld::Remove(obj); delete obj; -- cgit v1.2.3