Files
source/Standard Gaming Platform/stringicmp.cpp
T
Overhaul 6049e8da5a Added property pages to make it easy to change build language (at least with VS2K5)
Added support for Russian city names and Items
Fixed contract length exploit (hire merc for 2 weeks for the price of 1 day)
Fixed insurance emails repeating when you choose "delete" but then say no
Corrected UTF-8 to wide char translation on Windows platforms (Windows doesn't handle mbstowcs correctly)
Moved UTF-8 to Wide Char translation for item descriptions and names so it happens at XML load time (fix bug that Russian has half the description space)
Fix overflow when combining two items with high counts (such as 200-round boxes of ammo)
Path AI fixes
Fixed issues with non-interruptable animations causing infinite clock
Fixed some issues with soldiers not reaching their plotted destination
Fixed escorted players who were cowering, being unable to move after joining party
Only allow militia to climb roofs if their orders allow them to move
Fix bug where AI might climb the wrong roof on the way to the destination roof
Allow AI who have gone outside their patrol grid, to return to the Grid


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1702 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2008-01-09 02:08:39 +00:00

43 lines
878 B
C++

//
// Snap: Implementation of case-insensitive string comparison classes
//
#include "stringicmp.h"
//#include <cctype>
#include <ctype.h>
bool TStringiLess::operator() (std::string const& s1, std::string const& s2) const
{
// An MSVC compliance issue...
//using std::toupper;
#if 0
std::string::const_iterator p1 = s1.begin();
std::string::const_iterator p2 = s2.begin();
while (p1 != s1.end() && p2 != s2.end() && toupper(*p1) == toupper(*p2)) {
++p1;
++p2;
}
if (p1 == s1.end()) return p2 != s2.end();
if (p2 == s2.end()) return false;
return toupper(*p1) < toupper(*p2);
#else
const char *p1 = s1.c_str();
const char *p2 = s2.c_str();
while (*p1 && *p2 && toupper(*p1) == toupper(*p2)) {
++p1;
++p2;
}
if (!*p1) return *p2 != 0;
if (!*p2) return false;
return toupper(*p1) < toupper(*p2);
#endif
}