Fix for crash in _onZoningChanged methods when called by hidden objects.

Hidden objects are removed from the scene manager so calls to getSceneManager()->getZoneManager() crash and burn.
This commit is contained in:
chaigler 2020-07-02 15:50:29 -04:00
parent 005f7f6fd2
commit c4e00be91a
2 changed files with 6 additions and 2 deletions

View file

@ -260,7 +260,9 @@ void Forest::setTransform( const MatrixF &mat )
void Forest::_onZoningChanged( SceneZoneSpaceManager *zoneManager )
{
if ( mData == NULL || zoneManager != getSceneManager()->getZoneManager() )
const SceneManager* sm = getSceneManager();
if (mData == NULL || (sm != NULL && sm->getZoneManager() != NULL && zoneManager != sm->getZoneManager()))
return;
mZoningDirty = true;