]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/mapsector.cpp
added sand to map generator
[dragonfireclient.git] / src / mapsector.cpp
index f8367931496635002fa45264033e47cb2e3c67a6..1fd66879324f674dbae58ab2bfe2e5915bdcbe1e 100644 (file)
@@ -82,11 +82,16 @@ MapBlock * MapSector::getBlockBuffered(s16 y)
        return block;
 }
 
-MapBlock * MapSector::getBlockNoCreate(s16 y)
+MapBlock * MapSector::getBlockNoCreateNoEx(s16 y)
 {
        JMutexAutoLock lock(m_mutex);
        
-       MapBlock *block = getBlockBuffered(y);
+       return getBlockBuffered(y);
+}
+
+MapBlock * MapSector::getBlockNoCreate(s16 y)
+{
+       MapBlock *block = getBlockNoCreateNoEx(y);
 
        if(block == NULL)
                throw InvalidPositionException();
@@ -565,10 +570,15 @@ ServerMapSector* ServerMapSector::deSerialize(
 
        if(n != NULL)
        {
-               dstream<<"deSerializing existent sectors not supported "
+               dstream<<"WARNING: deSerializing existent sectors not supported "
                                "at the moment, because code hasn't been tested."
                                <<std::endl;
-               assert(0);
+
+               //assert(0);
+               MapSector *sector = n->getValue();
+               assert(sector->getId() == MAPSECTOR_SERVER);
+               return (ServerMapSector*)sector;
+
                // NOTE: At least hm_split mismatch would have to be checked
                
                //sector = n->getValue();
@@ -607,6 +617,7 @@ ServerMapSector* ServerMapSector::deSerialize(
        return sector;
 }
 
+#ifndef SERVER
 /*
        ClientMapSector
 */
@@ -667,5 +678,6 @@ void ClientMapSector::deSerialize(std::istream &is)
        m_corners[2] = c2;
        m_corners[3] = c3;
 }
+#endif // !SERVER
 
 //END