]> git.lizzy.rs Git - minetest.git/blobdiff - src/mapsector.cpp
Fix game selection in world creation (used always the first one)
[minetest.git] / src / mapsector.cpp
index 4a526c412539ad0ce83304f6df2f70f88560a91f..9b54328076ba69a1c8f4cfb88e299726768ed7c4 100644 (file)
@@ -23,10 +23,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "exceptions.h"
 #include "mapblock.h"
 
-MapSector::MapSector(Map *parent, v2s16 pos):
+MapSector::MapSector(Map *parent, v2s16 pos, IGameDef *gamedef):
                differs_from_disk(false),
                m_parent(parent),
                m_pos(pos),
+               m_gamedef(gamedef),
                m_block_cache(NULL)
 {
 }
@@ -89,7 +90,7 @@ MapBlock * MapSector::createBlankBlockNoInsert(s16 y)
 
        v3s16 blockpos_map(m_pos.X, y, m_pos.Y);
        
-       MapBlock *block = new MapBlock(m_parent, blockpos_map);
+       MapBlock *block = new MapBlock(m_parent, blockpos_map, m_gamedef);
        
        return block;
 }
@@ -151,8 +152,8 @@ void MapSector::getBlocks(core::list<MapBlock*> &dest)
        ServerMapSector
 */
 
-ServerMapSector::ServerMapSector(Map *parent, v2s16 pos):
-               MapSector(parent, pos)
+ServerMapSector::ServerMapSector(Map *parent, v2s16 pos, IGameDef *gamedef):
+               MapSector(parent, pos, gamedef)
 {
 }
 
@@ -186,7 +187,8 @@ ServerMapSector* ServerMapSector::deSerialize(
                std::istream &is,
                Map *parent,
                v2s16 p2d,
-               core::map<v2s16, MapSector*> & sectors
+               core::map<v2s16, MapSector*> & sectors,
+               IGameDef *gamedef
        )
 {
        /*
@@ -229,7 +231,7 @@ ServerMapSector* ServerMapSector::deSerialize(
        }
        else
        {
-               sector = new ServerMapSector(parent, p2d);
+               sector = new ServerMapSector(parent, p2d, gamedef);
                sectors.insert(p2d, sector);
        }
 
@@ -247,8 +249,8 @@ ServerMapSector* ServerMapSector::deSerialize(
        ClientMapSector
 */
 
-ClientMapSector::ClientMapSector(Map *parent, v2s16 pos):
-               MapSector(parent, pos)
+ClientMapSector::ClientMapSector(Map *parent, v2s16 pos, IGameDef *gamedef):
+               MapSector(parent, pos, gamedef)
 {
 }