Skip to content

Commit

Permalink
UPBGE: Fix scene replacement.
Browse files Browse the repository at this point in the history
The commit f62dca6 introduced a remove of the replaced
scene in the scene list, this call is unnecessary as
EXP_ListValue::SetValue is swapping the values.
The drawback of RemoveValue was to reduce the size of the
container by actually erasing the item.

This is fixed by not removing the scene but only replacing
its pointer.

Fix issue: #819.
  • Loading branch information
panzergame committed Sep 2, 2018
1 parent 552bf8e commit 60b5dc4
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion source/gameengine/Ketsji/KX_KetsjiEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,6 @@ void KX_KetsjiEngine::ReplaceScheduledScenes()
Scene *blScene = m_converter->GetBlenderSceneForName(newscenename);
if (blScene) {
DestructScene(scene);
m_scenes->RemoveValue(scene);

KX_Scene *tmpscene = CreateScene(blScene);
ConvertScene(tmpscene);
Expand Down

1 comment on commit 60b5dc4

@youle31
Copy link
Collaborator

@youle31 youle31 commented on 60b5dc4 Sep 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me too

Please sign in to comment.