From 06abd3f1eb32954fbcc375b4507cda2b753a1702 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Fri, 12 Jun 2020 13:25:53 -0500 Subject: [PATCH] adress #203 --- Engine/source/sfx/sfxWorld.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Engine/source/sfx/sfxWorld.h b/Engine/source/sfx/sfxWorld.h index 427e4721d..20f742380 100644 --- a/Engine/source/sfx/sfxWorld.h +++ b/Engine/source/sfx/sfxWorld.h @@ -361,9 +361,11 @@ void SFXWorld< NUM_DIMENSIONS, Object >::_onScopeIn( Object object ) F32 sortValue = _getSortValue( object ); while( iter != mScopeStack.end() && iter->mSortValue >= sortValue ) ++ iter; - - // Insert the object into the stack. - + // If the object is already on the scope stack, do not add it again + S32 index = _findScope(object); + if (index != -1) + return; + // Insert the object into the stack. mScopeStack.insert( iter, Scope( sortValue, object ) ); }