Browse Source

Merge branch 'alpha40_zonePicker2' of https://github.com/Azaezel/Torque3D into Preview4_0

Areloch 5 years ago
parent
commit
9524e77596
1 changed files with 14 additions and 14 deletions
  1. 14 14
      Engine/source/T3D/zone.cpp

+ 14 - 14
Engine/source/T3D/zone.cpp

@@ -28,8 +28,8 @@
 #include "scene/mixin/sceneAmbientSoundObject.impl.h"
 #include "scene/mixin/scenePolyhedralObject.impl.h"
 
-#include "gui/worldEditor/worldEditor.h"
 #include "scene/sceneManager.h"
+#include "gui/worldEditor/worldEditor.h"
 
 IMPLEMENT_CO_NETOBJECT_V1( Zone );
 
@@ -103,27 +103,27 @@ bool Zone::_doSelect(void* object, const char* index, const char* data)
 void Zone::selectWithin()
 {
    SimpleQueryList sql;
-   //getContainer()->polyhedronFindObjects(getPolyhedron(), 0xFFFFFFFF, SimpleQueryList::insertionCallback, &sql);
-
-   //replace the above with this once we stort out how to look up the managed zoneID from the insatnce itself
    Zone* zoneClient = (Zone*)getClientObject();
-   SceneZoneSpaceManager* zoneManager = zoneClient->getSceneManager()->getZoneManager();
-   if (zoneManager)
+   if (zoneClient)
    {
-      for (U32 zoneId = zoneClient->mZoneRangeStart; zoneId < zoneClient->mZoneRangeStart + zoneClient->mNumZones; ++zoneId)
-         for (SceneZoneSpaceManager::ZoneContentIterator iter(zoneManager, zoneId, false); iter.isValid(); ++iter)
-         {
-            SceneObject* obj = (SceneObject*)iter->getServerObject();
-            bool fullyEnclosed = true;
+      SceneZoneSpaceManager* zoneManager = zoneClient->getSceneManager()->getZoneManager();
+      if (zoneManager)
+      {
+         for (U32 zoneId = zoneClient->mZoneRangeStart; zoneId < zoneClient->mZoneRangeStart + zoneClient->mNumZones; ++zoneId)
+            for (SceneZoneSpaceManager::ZoneContentIterator iter(zoneManager, zoneId, false); iter.isValid(); ++iter)
+            {
+               SceneObject* obj = (SceneObject*)iter->getServerObject();
+               bool fullyEnclosed = true;
 
             for (SceneObject::ObjectZonesIterator zoneIter(obj); zoneIter.isValid(); ++zoneIter)
             {
                if (*zoneIter != zoneId)
                   fullyEnclosed = false;
+               }
+               if (fullyEnclosed)
+                  sql.insertObject(obj);
             }
-            if (fullyEnclosed)
-               sql.insertObject(obj); 
-         }
+      }
    }