Skip to content

Commit

Permalink
Fix wi::scene::LoadModel returning the wrong entity (#921)
Browse files Browse the repository at this point in the history
Fixed a bug caused by a typo in the LoadModel function call. The issue occurred because LoadModel(scene, fileName, transformMatrix, rootEntity) was mistakenly called instead of LoadModel2(scene, fileName, transformMatrix, rootEntity). The compiler did not catch this mistake because the last parameter of LoadModel is a boolean, and rootEntity was incorrectly used to satisfy that parameter.
  • Loading branch information
AttackButton authored Aug 12, 2024
1 parent 4717d75 commit 7449063
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion WickedEngine/wiScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7021,7 +7021,7 @@ namespace wi::scene
void LoadModel2(const std::string& fileName, const XMMATRIX& transformMatrix, Entity rootEntity)
{
Scene scene;
LoadModel(scene, fileName, transformMatrix, rootEntity);
LoadModel2(scene, fileName, transformMatrix, rootEntity);
GetScene().Merge(scene);
}

Expand Down
1 change: 1 addition & 0 deletions WickedEngine/wiScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ namespace wi::scene
virtual void Clear();
// Merge an other scene into this.
// The contents of the other scene will be lost (and moved to this)!
// Any references to entities or components from the other scene will now reference them in this scene.
virtual void Merge(Scene& other);
// Similar to merge but skipping some things that are safe to skip within the Update look
void MergeFastInternal(Scene& other);
Expand Down

0 comments on commit 7449063

Please sign in to comment.