diff options
author | Kahrl <kahrl@gmx.net> | 2012-01-21 00:11:44 +0100 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-01-22 17:24:50 +0200 |
commit | 157a4cf18cb9c098f465b8baecd7d2cd5705f2dd (patch) | |
tree | a194b86e0452d1dc892aec6b3ac940327ce85e2a /src/map.cpp | |
parent | f22c73f50169b978f13c0b6511805b9d4a1a6871 (diff) | |
download | minetest-157a4cf18cb9c098f465b8baecd7d2cd5705f2dd.tar.gz minetest-157a4cf18cb9c098f465b8baecd7d2cd5705f2dd.tar.bz2 minetest-157a4cf18cb9c098f465b8baecd7d2cd5705f2dd.zip |
Node placement / mineral / serialization / iron freq / node_dig callback
- Node placement code moved to Lua
- Mineral system removed (added default:stone_with_coal and default:stone_with_iron).
- MapBlock and MapNode serialization updated.
- Mapgen: Frequency of iron increased.
- node_dig callback and related changes.
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/map.cpp b/src/map.cpp index 8bdc2ad4c..31c0c958b 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -915,7 +915,7 @@ void Map::updateLighting(core::map<v3s16, MapBlock*> & a_blocks, /* */ void Map::addNodeAndUpdate(v3s16 p, MapNode n, - core::map<v3s16, MapBlock*> &modified_blocks, std::string &player_name) + core::map<v3s16, MapBlock*> &modified_blocks) { INodeDefManager *nodemgr = m_gamedef->ndef(); @@ -1010,9 +1010,6 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n, if(!meta){ errorstream<<"Failed to create node metadata \"" <<metadata_name<<"\""<<std::endl; - } else { - meta->setOwner(player_name); - setNodeMetadata(p, meta); } } @@ -1291,8 +1288,7 @@ bool Map::addNodeWithEvent(v3s16 p, MapNode n) bool succeeded = true; try{ core::map<v3s16, MapBlock*> modified_blocks; - std::string st = std::string(""); - addNodeAndUpdate(p, n, modified_blocks, st); + addNodeAndUpdate(p, n, modified_blocks); // Copy modified_blocks to event for(core::map<v3s16, MapBlock*>::Iterator @@ -3271,10 +3267,7 @@ void ServerMap::saveBlock(MapBlock *block) o.write((char*)&version, 1); // Write basic data - block->serialize(o, version); - - // Write extra data stored on disk - block->serializeDiskExtra(o, version); + block->serialize(o, version, true); // Write block to database @@ -3336,11 +3329,8 @@ void ServerMap::loadBlock(std::string sectordir, std::string blockfile, MapSecto } // Read basic data - block->deSerialize(is, version); + block->deSerialize(is, version, true); - // Read extra data stored on disk - block->deSerializeDiskExtra(is, version); - // If it's a new block, insert it to the map if(created_new) sector->insertBlock(block); @@ -3406,10 +3396,7 @@ void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool } // Read basic data - block->deSerialize(is, version); - - // Read extra data stored on disk - block->deSerializeDiskExtra(is, version); + block->deSerialize(is, version, true); // If it's a new block, insert it to the map if(created_new) |