diff options
author | est31 <MTest31@outlook.com> | 2015-09-18 13:45:42 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-09-19 20:57:29 +0200 |
commit | 452df1c723722183ebf3a332f7bcc355be5b2998 (patch) | |
tree | cfba8eaa11c7bdc1d6c245bfa85c973597bccc3c /src/content_mapnode.cpp | |
parent | 9c635f28ac2b103bf7196e47947bf64673c13393 (diff) | |
download | hax-minetest-server-452df1c723722183ebf3a332f7bcc355be5b2998.tar.gz hax-minetest-server-452df1c723722183ebf3a332f7bcc355be5b2998.zip |
Various style cleanups + unused code removal
-> Don't pass pointer to whole IGameDef to NodeMetadata constructors
and deserializers, but only to IItemDefManager, which is needed
-> Remove the unused content_mapnode_get_new_name() method
-> Fix style for MapBlock::deSerialize and MapBlock::deSerialize_pre22,
improving accuracy of error messages a bit
-> Fix style at other serialisation methods too
-> Improve accuracy of some comments
Diffstat (limited to 'src/content_mapnode.cpp')
-rw-r--r-- | src/content_mapnode.cpp | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index 3a4a4652a..a6bf0a82d 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -167,69 +167,3 @@ void content_mapnode_get_name_id_mapping(NameIdMapping *nimap) nimap->set(CONTENT_AIR, "air"); } -class NewNameGetter -{ -public: - NewNameGetter() - { - old_to_new["CONTENT_STONE"] = "default:stone"; - old_to_new["CONTENT_WATER"] = "default:water_flowing"; - old_to_new["CONTENT_TORCH"] = "default:torch"; - old_to_new["CONTENT_WATERSOURCE"] = "default:water_source"; - old_to_new["CONTENT_SIGN_WALL"] = "default:sign_wall"; - old_to_new["CONTENT_CHEST"] = "default:chest"; - old_to_new["CONTENT_FURNACE"] = "default:furnace"; - old_to_new["CONTENT_LOCKABLE_CHEST"] = "default:locked_chest"; - old_to_new["CONTENT_FENCE"] = "default:wooden_fence"; - old_to_new["CONTENT_RAIL"] = "default:rail"; - old_to_new["CONTENT_LADDER"] = "default:ladder"; - old_to_new["CONTENT_LAVA"] = "default:lava_flowing"; - old_to_new["CONTENT_LAVASOURCE"] = "default:lava_source"; - old_to_new["CONTENT_GRASS"] = "default:dirt_with_grass"; - old_to_new["CONTENT_TREE"] = "default:tree"; - old_to_new["CONTENT_LEAVES"] = "default:leaves"; - old_to_new["CONTENT_GRASS_FOOTSTEPS"] = "default:dirt_with_grass_footsteps"; - old_to_new["CONTENT_MESE"] = "default:mese"; - old_to_new["CONTENT_MUD"] = "default:dirt"; - old_to_new["CONTENT_CLOUD"] = "default:cloud"; - old_to_new["CONTENT_COALSTONE"] = "default:coalstone"; - old_to_new["CONTENT_WOOD"] = "default:wood"; - old_to_new["CONTENT_SAND"] = "default:sand"; - old_to_new["CONTENT_COBBLE"] = "default:cobble"; - old_to_new["CONTENT_STEEL"] = "default:steel"; - old_to_new["CONTENT_GLASS"] = "default:glass"; - old_to_new["CONTENT_MOSSYCOBBLE"] = "default:mossycobble"; - old_to_new["CONTENT_GRAVEL"] = "default:gravel"; - old_to_new["CONTENT_SANDSTONE"] = "default:sandstone"; - old_to_new["CONTENT_CACTUS"] = "default:cactus"; - old_to_new["CONTENT_BRICK"] = "default:brick"; - old_to_new["CONTENT_CLAY"] = "default:clay"; - old_to_new["CONTENT_PAPYRUS"] = "default:papyrus"; - old_to_new["CONTENT_BOOKSHELF"] = "default:bookshelf"; - old_to_new["CONTENT_JUNGLETREE"] = "default:jungletree"; - old_to_new["CONTENT_JUNGLEGRASS"] = "default:junglegrass"; - old_to_new["CONTENT_NC"] = "default:nyancat"; - old_to_new["CONTENT_NC_RB"] = "default:nyancat_rainbow"; - old_to_new["CONTENT_APPLE"] = "default:apple"; - old_to_new["CONTENT_SAPLING"] = "default:sapling"; - // Just in case - old_to_new["CONTENT_IGNORE"] = "ignore"; - old_to_new["CONTENT_AIR"] = "air"; - } - std::string get(const std::string &old) - { - StringMap::const_iterator it = old_to_new.find(old); - if (it == old_to_new.end()) - return ""; - return it->second; - } -private: - StringMap old_to_new; -}; - -NewNameGetter newnamegetter; - -std::string content_mapnode_get_new_name(const std::string &oldname) -{ - return newnamegetter.get(oldname); -} |