From f4b66cbbdbcf26461fb7104339d5d6460193029d Mon Sep 17 00:00:00 2001 From: "lapayo94@gmail.com" Date: Fri, 13 Jul 2012 17:22:58 +0000 Subject: fixed /tp command made cWorld::DoWithPlayer case insensitive git-svn-id: http://mc-server.googlecode.com/svn/trunk@662 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Globals.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/Globals.h') diff --git a/source/Globals.h b/source/Globals.h index 65db1b436..9b057d262 100644 --- a/source/Globals.h +++ b/source/Globals.h @@ -200,3 +200,15 @@ public: +//Common functions +//Taken from http://stackoverflow.com/questions/11635/case-insensitive-string-comparison-in-c +inline bool iequals(const std::string& a, const std::string& b) +{ + unsigned int sz = a.size(); + if (b.size() != sz) + return false; + for (unsigned int i = 0; i < sz; ++i) + if (tolower(a[i]) != tolower(b[i])) + return false; + return true; +} -- cgit v1.2.3