From fbefff45b12b0e164d7f771275dd117cd47f943f Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 8 Sep 2012 16:38:27 +0000 Subject: [PATCH] Fixed the case-sensitiveness of the item map. git-svn-id: http://mc-server.googlecode.com/svn/trunk@848 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/BlockID.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/BlockID.cpp b/source/BlockID.cpp index a326d25d6..b1d00d391 100644 --- a/source/BlockID.cpp +++ b/source/BlockID.cpp @@ -26,7 +26,16 @@ bool g_BlockRequiresSpecialTool[256]; class cBlockIDMap { - typedef std::map > ItemMap; + // Making the map case-insensitive: + struct Comparator + { + bool operator()(const AString & a_Item1, const AString & a_Item2) + { + return (NoCaseCompare(a_Item1, a_Item2) > 0); + } + } ; + + typedef std::map, Comparator> ItemMap; public: cBlockIDMap(void)