Merge pull request #242 from SHADE-DP/SP3-141-Camera-System
FIxed major crashes caused by main camera retrieval and entity destroy
This commit is contained in:
commit
437cb075d3
|
@ -1,20 +1,16 @@
|
||||||
0 1
|
0 1
|
||||||
1 2
|
1 2
|
||||||
2 3
|
2 3
|
||||||
3 4
|
3 4
|
||||||
4 5
|
4 5
|
||||||
5 6
|
5 6
|
||||||
6 7
|
6 7
|
||||||
7 8
|
7 8
|
||||||
8 9
|
8 9
|
||||||
9 10
|
9 10
|
||||||
10 11
|
10 11
|
||||||
11 12
|
11 12
|
||||||
12 13
|
12 13
|
||||||
13 14
|
13 14
|
||||||
14 15
|
14 15
|
||||||
15 16
|
15 16
|
||||||
|
|
||||||
note:
|
|
||||||
All collision tags should follow the above format "index<space>tag name".
|
|
||||||
If it fails to follow this, the default tag names will be used.
|
|
||||||
|
|
|
@ -43,7 +43,9 @@ namespace SHADE
|
||||||
if (!camComponent)
|
if (!camComponent)
|
||||||
{
|
{
|
||||||
SHLOG_WARNING("Camera Director warning: Entity does not have a camera");
|
SHLOG_WARNING("Camera Director warning: Entity does not have a camera");
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
return camComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ namespace SHADE
|
||||||
//Call all the children to Destroy themselves first before the parent is destroyed.
|
//Call all the children to Destroy themselves first before the parent is destroyed.
|
||||||
if (entityVec[eIndex])
|
if (entityVec[eIndex])
|
||||||
{
|
{
|
||||||
auto& children = SHSceneManager::GetCurrentSceneGraph().GetChildren(eID);
|
auto children = SHSceneManager::GetCurrentSceneGraph().GetChildren(eID);
|
||||||
for (auto& child : children)
|
for (auto& child : children)
|
||||||
{
|
{
|
||||||
DestroyEntity(child->GetEntityID());
|
DestroyEntity(child->GetEntityID());
|
||||||
|
|
Loading…
Reference in New Issue